[opencms-dev] OpenCms login

maria.freixes_graells at alcatel.es maria.freixes_graells at alcatel.es
Fri Jul 14 17:01:23 CEST 2006


Hello Christian!!!

Thanks! Many!

I've seen your post, but it seems to be not displayed correctly.
I think that there is code errors with "{" characters. Could you please 
take a look at this view?


===frontendlogin.jsp====================================================
 cms.getCmsObject() -->
<%@ page session="true" import="org.opencms.main.*, org.opencms.jsp.*,
org.opencms.file.*, java.lang.String" %>
<%
    CmsJspActionElement cms = new
CmsJspActionElement(pageContext,request,response);
        String user = request.getParameter("user");
        String password = request.getParameter("password");
        String url = request.getParameter("url");

        //form not submitted? => show login form.
        if((user==null)||(user.length()==0)) {
          %><html><head><title>Frontend login</title></head><body
onload="document.forms[0].elements[0].focus()"><h1>please
login:</h1><form method="post">
             <p>username: <input name="user" /></p>
             <p>password: <input name="password" type="password" /></p>
             <p><input type="submit"/></p>
            </form></body></html><%

    } else {

      CmsObject cmsObject = cms.getCmsObject();
      cmsObject.loginUser(user, password);
      CmsProject cmsproject = cmsObject.readProject("Offline");
      cmsObject.getRequestContext().setCurrentProject(cmsproject);
      cmsObject.getRequestContext().setSiteRoot("/sites/default");
 
     if( url!=null && url.length()>0 )
        response.sendRedirect(url);
      else
        response.sendRedirect(cms.link("/index.html"));
   
%>



Christian Steinert wrote:
> maria.freixes_graells at alcatel.es schrieb:
>   
>> Hello!
>>
>> I would like to change the redirection that the OpenCms login page do to
>> the Workplace, I would like to redirect to a welcome page that I've
>> create instead.
>>
>> Anyone knows how can I do this?
>>
>> Thanks a lot,
>> Maria
>>
>>
>> "Science knows no country, because knowledge belongs to humanity, and is
>> the torch which illuminates the world." - Louis Pasteur
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>>     
>
> I had posted a JSP that displays a simple form, allows to login and
> redirects somewhere else after logging in.
>
> search the mailing list archive for "sample for frontend login"
>
> c.
>   
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list