Re: User/ACL management class update
| From: | Bertrand Mansion | Date: | Mon, 08 Jul 2002 09:26:25 +0000 |
| Subject: | Re: User/ACL management class update | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7555@lists.php.net to get a copy of this message | ||
le 8/07/02 1:39, Markus Wolff à wolff@21st.de a écrit :
> Hi there,
>
> in the last few weeks we´ve been discussing various possibilities for a
> new authorization/authentication system. I had announced to have
> something like this in the works but did not yet publish anything
> because suddenly I went out of spare time to continue developing.
>
> In the meantime, however, I managed to put together a working example so
> it´s time to look at the code to see what we´re talking about. You can
> see my freshly made project homepage here:
> http://projects.21st-hq.de/liveuser/
>
> I´d like to hear some feedback if you think this is a good way to go or
> if it needs improvement (it definitely does - check the todo list in the
> "About" section). If you guys think it´s usable, I´d like to propose it
> for inclusion in PEAR.
>
> Regards,
> Markus
Hi Markus,
In liveUser :
if (is_array($this->groupRights)) {
while(list($currentGroup, $groupAreas) = each($this->groupRights)) {
while(list($currentArea, $areaRights) = each($groupAreas)) {
while(list($currentRight, $rightName) = each($areaRights)) {
$tmpRights[$currentArea][$rightName] = 1;
}
}
}
} else {
$this->groupRights = FALSE;
}
Maybe you could use 'bit bashing' here to make it lighter ?
Going through the rights array every time you need to know a user has the
right to be here is a bit heavy.
You might also want to extend PEAR in order to make use of pear error
handling. I would also suggest you use constants to define your login error
codes like in Auth.
Bertrand Mansion
Mamasam