[opencms-dev] WebUser delete problem

Tomas tommaso.masi at tiscali.it
Sat Mar 4 10:19:39 CET 2006


Thank you for your suggestion, Dmitry.
I tried your solution just to discover that the Guest user I used to
initialize the CmsObject has not the account manager role needed to delete a
WebUser.
If this is true, I think it is impossible to write application code to
implement a delete function for a WebUser that want to remove itself from
the set of registered users of a site build on top of OpenCms.
Can someone from the OpenCms development team answer to this question?
Thank you

Tomas


-----Original Message-----
From: Dmitry Lihachev [mailto:lda at tusur.ru]
Sent: venerdì 3 marzo 2006 8.20
To: tommaso.masi at tiscali.it; The OpenCms mailing list
Subject: Re: [opencms-dev] WebUser delete problem


Hello, Tomas. 02.03.2006 23:23 You wrote:
> I cannot delete a WebUser from my application code using the following
> statements:
>
>    CmsObject cms = OpenCms.initCmsObject((new
> CmsDefaultUsers()).getUserGuest());
>    CmsUser user = cms.readWebUser(username);
>
>    cms.deleteWebUser(user.getId());
>  From my analysis it seems that the
> CmsSecurityManager.checkOfflineProject() function fails when it is
> called during the CmsSecurityManager.deleteWebUser() function (called by
> CmsObject.deleteWebUser() function).
> If this is the corrrect behaviour, a WebUser can only deleted inside the
> Offline project. But in this case how can let a registered user
> (implemented by means of a WebUser) delete itself from my site?
Try to switch current project to Offline.
cms.getCmsObject().getRequestContext().setCurrentProject(cms.getCmsObject().
readProject("Offline"));

--
icq uin: 120606300, jabber: lda at hostel.tusur.ru
e-mail: lda at tusur.ru, http://ilab.tusur.ru




More information about the opencms-dev mailing list