[opencms-dev] Visibility of the OpenCMS Object inside Struts Action SOLVED!!
Matutek Basilico
matute.listas at gmail.com
Tue May 10 16:26:52 CEST 2005
Hi again!
I'm now with another problem, related to the mail below
Now I want to log in the actual user, so I don't know the password BUT
I can get the actual user...
take a look to the code:
***************************************
CmsWorkplaceSettings cmsws = (CmsWorkplaceSettings)
session.getAttribute(CmsWorkplace.C_SESSION_WORKPLACE_SETTINGS);
CmsUser cmsu = cmsws.getUser();
this.log("login in user in opencms user ==> " + cmsu.getName());
CmsObject cmso = OpenCms.initCmsObject("Guest");
cmso.loginUser(cmsu.getName(), cmsu.getPassword());
this.log("login in user OK...");
//4=OFFLINE PROJECT
cmso.getRequestContext().setCurrentProject(cmso.readProject(4));
*********************************
It throws an exception 'cause the password is encypted.
How Can I log an user with the encrypted password or How can I
des-encrypt the password so I can send the original strings...
Thanks in advance for your help!.
Matutek
> I'm reading a little more in the list..so..
>
> now I can create a resource inside a Struts Action or a Java Object!!
>
> Here the code:
>
> CmsObject cmso = OpenCms.initCmsObject("Guest");
> cmso.loginUser("Admin", "admin");
> //4=OFFLINE PROJECT
> cmso.getRequestContext().setCurrentProject(cmso.readProject(4));
> CmsResource cmsr = cmso.createResource("/ucdworks/action-test/test1.html", 12);
>
> I think now I have to unlock and so on..but the more important thing
> seems to be ok!
>
> THANKS Stephan Hartmann!!
More information about the opencms-dev
mailing list