本文整理汇总了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;
}
}