本文整理汇总了PHP中K2HelperPermissions::checkPermissions方法的典型用法代码示例。如果您正苦于以下问题:PHP K2HelperPermissions::checkPermissions方法的具体用法?PHP K2HelperPermissions::checkPermissions怎么用?PHP K2HelperPermissions::checkPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类K2HelperPermissions
的用法示例。
在下文中一共展示了K2HelperPermissions::checkPermissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.tooltip');
$user =& JFactory::getUser();
$view = JRequest::getWord('view', 'items');
$view = JString::strtolower($view);
$task = JRequest::getCmd('task');
$params =& JComponentHelper::getParams('com_k2');
if (K2_JVERSION == '15') {
if ($params->get('lockTags') && $user->gid <= 23 && ($view == 'tags' || $view == 'tag') || $user->gid <= 23 && ($view == 'extrafield' || $view == 'extrafields' || $view == 'extrafieldsgroup' || $view == 'extrafieldsgroups' || $view == 'user' || $view == 'users' && $task != 'element' || $view == 'usergroup' || $view == 'usergroups')) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
} else {
JLoader::register('K2HelperPermissions', JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'permissions.j16.php');
K2HelperPermissions::checkPermissions();
// Compatibility for gid variable
if ($user->authorise('core.admin', 'com_k2')) {
$user->gid = 1000;
} else {
$user->gid = 1;
}
if ($params->get('lockTags') && !$user->authorise('core.admin', 'com_k2') && ($view == 'tags' || $view == 'tag') || !$user->authorise('core.admin', 'com_k2') && ($view == 'extrafield' || $view == 'extrafields' || $view == 'extrafieldsgroup' || $view == 'extrafieldsgroups' || $view == 'user' || $view == 'users' || $view == 'usergroup' || $view == 'usergroups')) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
}
$document =& JFactory::getDocument();
if (version_compare(JVERSION, '1.6.0', 'ge')) {
JHtml::_('behavior.framework');
} else {
JHTML::_('behavior.mootools');