Re: AddUser basic question
Matthias Nothhaft <[email protected]> Tue, 08 Nov 2005 18:51:02 +0100
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
cron-jbULQAKo4A5fyO9Q7EP/[email protected] schrieb: >Just to check if i got this right > >>From LiverUser.php > */ >define('LIVEUSER_MAX_LEVEL', 3); > >/**#@+ > * Usertypes > * > * @var integer > */ >/** > * lowest user type id > */ >define('LIVEUSER_ANONYMOUS_TYPE_ID', 0); >/** > * lowest user type id > */ >// higest user type id >define('LIVEUSER_USER_TYPE_ID', 1); >/** > * lowest admin type id > */ >define('LIVEUSER_ADMIN_TYPE_ID', 2); >define('LIVEUSER_AREAADMIN_TYPE_ID', 3); >define('LIVEUSER_SUPERADMIN_TYPE_ID', 4); >/** > * higest admin type id > */ >define('LIVEUSER_MASTERADMIN_TYPE_ID', 5); >/**#@-*/ > > That's it. >So if I want to add a admin user I use $admin->addUser($data, LIVEUSER_MASTERADMIN_TYPE_ID) ? > > You can do so. Note that the masteradmin user type has the highest permission level. That implies that he automatically has all rights without the need of giving this user any rights! > >I was hopping to set permissions to groups set permissions based on groups, so I guess I should add always the same user level and control what can a user do based on his group permissions. > > Yes, you should always set the appropriate user type (permission level) to each new user! Regards, Matthias > > >This show how flexible is LiverUser, nice :) > > > >----- Original Message ----- >From: "Matthias Nothhaft" <[email protected]> >To: "LiveUser-DevList" <[email protected]> >Sent: Tuesday, November 08, 2005 1:20 PM >Subject: Re: [LiveUser] AddUser basic question > > > > >>cron-jbULQAKo4A5fyO9Q7EP/[email protected] schrieb: >> >> >> >>>Hello, >>> >>> >>>What the param $type is for? >>> >>>I know from the examples that is the user level, but user level for what? >>> >>>$admin->addUser($data, $type = LIVEUSER_USER_TYPE_ID) >>> >>> >>> >>> >>See it as level of permission. >> >>Take a look at LiveUser.php >>There are some user type constants defined. >>Using these levels you can easily separate users into general roles >>like: "anonyous users", "registered users", "administrators", ... >> >>Hope that helps. >> >>Regards, >>Matthias >> >>_______________________________________________ >>LiveUser mailing list >>[email protected] >>http://mailman.21st-hq.de/mailman/listinfo/liveuser >> >> >> >_______________________________________________ >LiveUser mailing list >[email protected] >http://mailman.21st-hq.de/mailman/listinfo/liveuser > > >