[opencms-dev] Deactivate a User in java-code

Frank Pertack fpertack at vater-gruppe.de
Thu Jul 22 10:18:31 CEST 2010


Hello,

I have to write a class, in which a user can be deavtivated by a web-Interface.

I found out the method "setDisabled()" in the CmsUser is deprecated. I shall use the CmsPrincipal instead. 
But somehow I am not able to instantiate a cmsPrincipal. 
Can anybody help me with a code-snippet, how I shall use the CmsPrincipal? 
- How can I load the User-Data with "readPrincipal(CmsObject cms, CmsUUID id)"?
- Do I understand it right that the new method is "cmsPrincipal.setEnabled(false)" when I like to disable a user?

Thank you in advance.

Best regards
Frank


More information about the opencms-dev mailing list