[opencms-dev] User out of group? possible?

M Butcher mbutcher at grcomputing.net
Wed Nov 19 18:44:01 CET 2003


ambiesense at gmx.de wrote:
> I have this code line:
> 
> cmsObject.addUser("mylogin", "mypassword", null, null, null, 0);

cmsObject.addUser("testuser","testpassword", "Guests", "This user is a 
test user", new java.util.Hashtable, cmsObject.C_FLAG_ENABLED);

> which does not work since the OpenCMS is complaining not to know a null
> group (which is true). Can I use a default group (if no group is known)? Is the
> only flag one should use here the enable flag for the user(C_FLAG_ENABLED) and
> how do I handle the fact that I do not want to store any additional user
> info.

How about using Guests for the default group? Or create your own default 
group.

> Maybe you can just provide me some working examples for the line aboth?
> 
> Also I look for an example if you want to add a new group, which has no
> parent (possible?) like the code below:
> 
> addGroup("myGroup", "This is my group", ???FLAGS???,  ???NO PARENT BUT
> HOW???)

Have you looked through the OpenCms code to see what they do with addGroup?

According to the code, NULL is an expected value for the parent (so is 
""). It gets the value "-1" in the database.

The group flags are in I_CmsConstants, starting with C_FLAG_GROUP_* (and 
0 seems to be the main one I see in my groups, which is C_FLAG_ENABLED 
-- a generic flag)

Matt




More information about the opencms-dev mailing list