本文整理匯總了PHP中JEVHelper::getUserType方法的典型用法代碼示例。如果您正苦於以下問題:PHP JEVHelper::getUserType方法的具體用法?PHP JEVHelper::getUserType怎麽用?PHP JEVHelper::getUserType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JEVHelper
的用法示例。
在下文中一共展示了JEVHelper::getUserType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: JEVAccess
function JEVAccess()
{
// Editor usertype check
global $acl;
$user = JFactory::getUser();
$this->access = new stdClass();
$acl = JFactory::getACL();
$this->access->canEdit = $acl->acl_check('action', 'edit', 'users', JEVHelper::getUserType($user), 'content', 'all');
$this->access->canEditOwn = $acl->acl_check('action', 'edit', 'users', JEVHelper::getUserType($user), 'content', 'own');
$this->access->canPublish = $acl->acl_check('action', 'publish', 'users', JEVHelper::getUserType($user), 'content', 'all');
}
示例2: isAdminUser
public static function isAdminUser($user = null)
{
if (is_null($user)) {
$user = JFactory::getUser();
}
if (JVersion::isCompatible("1.6.0")) {
//$access = JAccess::check($user->id, "core.admin","com_jevents");
$access = $user->authorise('core.admin', 'com_jevents');
return $access;
} else {
if (strtolower(JEVHelper::getUserType($user)) != "super administrator" && strtolower(JEVHelper::getUserType($user)) != "administrator") {
return false;
}
return true;
}
}