[opencms-dev] login with current user
Christian Steinert
christian_steinert at web.de
Mon Jul 3 21:55:00 CEST 2006
No - no.
You have to do it differently:
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
CmsObject ocms = cms.getCmsObject();
In this way you will get a CmsObject that is already initialized for the current user.
What you have tried to do - creating a completely new CmsObject - is only meant for *very* special cases.
hth
christian
> Why don't you store the user's password in session?
>
> El lun, 03-07-2006 a las 08:35 -0700, manolo fdez escribió:
> > When I make some operations with files on the VFS, I need to do it with the
> > user who is currently logged in.
> > But I don't want to ask the user for retyping his password everytime I need
> > it.
> >
> > I made an aproach, but It doesn't work because the method getPassword()
> > returns the crypted password, not the original.
> > Do you know if it is possible to login with the current user?
> >
> >
> >
> >
> > CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
> > response);
> >
> > CmsObject ocms = OpenCms.initCmsObject("Guest");
> > CmsUser cuser = ocms.readUser( cms.user("name") );
> >
> >
> > ocms.loginUser( cuser.getName(), cuser.getPassword() );
> >
> >
> >
> > Thanks.
> --
>
> Saludos
>
> --
> -- Aitor de la Puente
> --
>
>
>
> _______________________________________________
> 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
______________________________________________________________________________
Mit WEB.DE iNews werden Sie über die Ergebnisse der wichtigsten WM-Begegnungen
per SMS informiert: http://freemail.web.de/features/inews.htm/?mc=021202
More information about the opencms-dev
mailing list