예제 #1
0
 function get_permission($name, $type = 'system')
 {
     return CAT_Users::get_permission($name, $type);
 }
예제 #2
0
 /**
  * check module permissions for current user
  *
  * @access public
  * @param  string  $module - module to check
  * @return
  **/
 public static function checkModulePermissions($module)
 {
     if (CAT_Users::is_root()) {
         return true;
     }
     return CAT_Users::get_permission($module, 'module');
 }
예제 #3
0
파일: tool.php 프로젝트: ircoco/BlackCatCMS
    }
}
$header = CAT_Helper_Validate::sanitizeGet('ajax') ? false : true;
$backend = CAT_Backend::getInstance('admintools', 'admintools', $header);
$admin =& $backend;
$val = CAT_Helper_Validate::getInstance();
$get_tool = $val->sanitizeGet('tool', NULL, true);
if ($get_tool == '') {
    $get_tool = $val->sanitizePost('tool', NULL, true);
}
if ($get_tool == '') {
    header("Location: index.php");
    exit(0);
}
// check tool permission
if (!CAT_Users::get_permission($get_tool, 'module')) {
    header("Location: index.php");
    exit(0);
}
global $parser;
$parser->setGlobals('CAT_ADMIN_URL', CAT_ADMIN_URL);
// ==============================
// ! Check if tool is installed
// ==============================
if (!CAT_Helper_Addons::isModuleInstalled($get_tool)) {
    header("Location: index.php");
    exit(0);
}
$tool = CAT_Helper_Addons::getAddonDetails($get_tool);
// Set toolname
$tpl_data['TOOL_NAME'] = $tool['name'];