[opencms-dev] Problem loggin in as guest user in 6.0.3

Michael Moossen m.moossen at alkacon.com
Thu Dec 22 09:26:48 CET 2005


Hi Pere!

The 'bug' was that at many places in the code the CmsDefaultUsers class was
directly used, what is wrong. You should only access it through the
OpenCms.getDefaultUsers() method, if not the user names will not be mapped as
defined in the opencms-importexport.xml file. (i thought your problem was
related to this).
to logout just invalidate the session.

-- 
Regards
Michael Moossen

Alkacon Software GmbH - The OpenCms Experts
http://www.alkacon.com


Quoting Pere Torrodellas <ptorrodellas at fihoca.com>:

> Hello,
> 
> Can someone please provide more information about the bug Machael refers to?
> The provided code throws the same exception, and I was unable to find the
> bug in the bug tracking system.
> 
> Thanks,
> 
> Pere
> 
> ----- Original Message -----
> From: "Michael Moossen" <m.moossen at alkacon.com>
> To: "The OpenCms mailing list" <opencms-dev at opencms.org>
> Sent: Tuesday, December 20, 2005 4:57 PM
> Subject: Re: [opencms-dev] Problem loggin in as guest user in 6.0.3
> 
> 
> > Hi, Pere!
> >
> >   This was a bug in 6.0.2.
> >
> >   The right code is:
> > String guestUser = OpenCms.getDefaultUsers().getUserGuest();
> > cms.loginUser(guestUser, "");
> >
> > HTH
> > --
> > Regards
> > Michael Moossen
> >
> > Alkacon Software GmbH - The OpenCms Experts
> > http://www.alkacon.com
> >
> >
> > Quoting Pere Torrodellas <ptorrodellas at fihoca.com>:
> >
> > > Hello,
> > >
> > > To logoff a webUser we were using the method of loggin in as the guest
> user,
> > > which worked perfectly with OpenCms 6.0.0:
> > >
> > > CmsJspActionElement cmsj =
> > >     new CmsJspActionElement( pageContext, request, response );
> > > CmsObject cms = cmsj.getCmsObject();
> > > String defaultUser = (new CmsDefaultUsers()).getUserGuest();
> > > cms.loginUser(defaultUser, "");
> > >
> > > Now we are enhancing the same application in OpenCms 6.0.3 (updated from
> > > 6.0.2), but the above code gets an exception:
> > >
> > > org.opencms.db.CmsDbEntryNotFoundException: User "{0}" was not found.
> > >
> > > I had a look at the source code, but was unable to determine where this
> user
> > > "0" comes from. The getUserGuest() method does return "Guest", user
> "Guest"
> > > does exist, and guest users can access the application all right.
> > >
> > > Has something changed from 6.0.0 to 6.0.3? Can someone suggest an
> > > explanation?
> > >
> > > Thanks for any help,
> > >
> > > Pere
> > >
> > >
> > >
> > > _______________________________________________
> > > This mail is send to you from the opencms-dev mailing list
> > > To change your list options, or to unsubscribe from the list, please
> visit
> > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > >
> >
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the opencms-dev mailing list