[opencms-dev] WebUser delete problem

Dmitry Lihachev lda at tusur.ru
Fri Mar 3 08:19:45 CET 2006


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