[opencms-dev] Re: Direct edit

Christian Steinert christian_steinert at web.de
Thu Mar 2 18:10:17 CET 2006


The OpenCms mailing list <opencms-dev at opencms.org> schrieb am 02.03.06 14:51:08:
> 
> 
> > Did you create an own login form?
> > How do users log in?
> 
> > The idea is that you create an own JSP file which logs the user into
> the system and then switches the project to whatever you want.
> > Then the JSP would probably redirect the user to the index page of
> your website, so that they could start right away with frontend-editing.
> 
> > Regards
> > Christian
> 
> I have problems getting this working too. For a test, I just did a jsp
> that logs in a workplace user and then sends him to the website he
> should be able to edit:
> 
> <%@ page session="false" import="org.opencms.main.*, org.opencms.jsp.*,
> org.opencms.file.*, java.lang.String" %>
> <%
> 	CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> request, response);
> 	CmsObject cmsObject = OpenCms.initCmsObject( "Guest" );
> 	cmsObject.loginUser("xxx", "yyy");
> 	CmsProject cmsproject = cmsObject.readProject("Offline");
> 	cmsObject.getRequestContext().setCurrentProject(cmsproject);
> 	cmsObject.getRequestContext().setSiteRoot("/sites/default");
> 	response.sendRedirect(cms.link("/testsite/"));
> %>
> 
> That seems to log in the user and redirects him, but no direct editing
> is possible (which is, when I call the same site from within the
> workplace).
> 
> Is there anybody who has achieved this yet and could help? I just can't
> believe it's that difficult or impossible...
> 
> Best regards,
> Roman Uhlig
> 

Hi Roman,

I must admit, that I have not tried this yet.

What happens, if you do not redirect, but after logging in, etc output the following:

<cms:user property="name"/> 
<%=cmsObject.getRequestContext().getCurrentProject().getName() %>
<%=cmsObject.getRequestContext().getSiteRoot() %>


Regards
Christian


______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130




More information about the opencms-dev mailing list