Re: [LiveUser] adding user to permission container only
| From: | Lukas Smith | Date: | Sun, 05 Mar 2006 08:56:23 +0000 |
| Subject: | Re: [LiveUser] adding user to permission container only | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23223@lists.php.net to get a copy of this message | ||
Lukas Kahwe Smith wrote:
I should also mention that the container name is available as a property in $LUA if you have initialized the auth container accordingly: $LUA->authContainerName Initialization is done by calling the init() method. The init() method accepts an auth_user_id or an auth_container_name. If you pass an auth_user_id it will search the auth container sequentially looking for the first container with the given auth_user_id (this does not take into account that the same auth_user_id could be used in multiple containers). If instead you passed an auth_container_name it will use that. If you have not specified an auth_user_id or auth_container_name then init will simply use the first container defined in the authContainers config array. The init() method will then also initialize the perm container. Alternatively you can call setAdminAuthContainer() with an auth container name directly. regards, LukasBut I don't know how I can add user rights to this users. How can i add a user to the permissions container that is already stored in the authentication container? If I try the ::addUser method, LieveUser tries to add the user to both containers and gives an error message.You would need to use the addUser() method in the perm container. $data = array( 'auth_user_id' => $auth_user_id, // the unique user id in the given auth container 'auth_container_name' => $auth_container_name, // this is the key in the authContainers configuration array for the container that stores the given user 'type' => LIVEUSER_USER_TYPE_ID // optional or some other type id ); $perm_user_id = $LUA->perm->addUser();