function get_permission($name, $type = 'system') { return CAT_Users::get_permission($name, $type); }
/** * 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'); }
} } $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'];