Home » Authentication » LiveUser_Admin » Bug #4619
method that check if an permId is an areaAdmin
Details
| Request #4619 | method that check if an permId is an areaAdmin |
|---|---|
| Submitted | 2005-06-17 13:39 UTC |
| From | fabio at bs2 dot com dot br |
| Status | Bogus |
| Package | LiveUser_Admin |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-06-17 13:39 UTC] fabio at bs2 dot com dot br
Description:
------------
to user enter in the administrator area of LiveUser, he will be authenticated and really an admin. Then I have to check if the permId is an adminArea.
what I can do is in reproduce code.
but have a bug when area don't have right, because the return is an array without element in this case and when the permId is not really admin.
One select in area_admin_areas will be better than this.
Reproduce code:
---------------
$lu =& LiveUser::singleton($LuConf);
$isAdmin = false;
if ($lu->isLoggedIn()):
$adminAreas = $lu->_perm->readAreaAdminAreas(
$lu->getProperty('permUserId','perm'));
if (is_array($adminAreas) && count($adminAreas))
$isAdmin = true;
endif;
[2005-06-17 13:42 UTC] smith at backendmedia dot com
$lu->getProperty('userType') will get you a value that will denote if the user is an admin
the value will be LIVEUSER_AREAADMIN_TYPE_ID for an areaadmin and higher for a superadmin