PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser_Admin » Bug #4619

method that check if an permId is an areaAdmin

Details

Request #4619method that check if an permId is an areaAdmin
Submitted2005-06-17 13:39 UTC
Fromfabio at bs2 dot com dot br
StatusBogus
PackageLiveUser_Admin
PHP VersionIrrelevant
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