本文整理匯總了PHP中core\Security::serviceAuthorized方法的典型用法代碼示例。如果您正苦於以下問題:PHP Security::serviceAuthorized方法的具體用法?PHP Security::serviceAuthorized怎麽用?PHP Security::serviceAuthorized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core\Security
的用法示例。
在下文中一共展示了Security::serviceAuthorized方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: strtolower
$s = $_REQUEST->service;
} else {
$_REQUEST->service = $s;
}
if (!empty($_REQUEST->request)) {
$r = $_REQUEST->request;
} else {
$_REQUEST->request = $r;
}
$s = strtolower($s);
$s = ucfirst($s);
\Core\Event::fire("Page_PreLoad", $_REQUEST);
// Test security access
// redirect to defaultService if not allow
try {
\Core\Security::serviceAuthorized($s, $r);
} catch (\Core\CException $exception) {
\Core\Server::sendHeaderStatus(500);
\Core\Event::fire("Page_AccessDeny", $_REQUEST, $exception);
die($exception->getMessage());
}
try {
// Test if session dir ok
$sessionPath = session_save_path();
if (!empty($sessionPath)) {
if (!is_dir($sessionPath) || !is_writable($sessionPath)) {
throw new \Core\CException("Server error : Php session directory \"" . $sessionPath . "\n (" . \Core\Server::perms($sessionPath) . ")\" is not writable.");
}
}
// Test signature du controller
if (class_exists($s) && method_exists($s, $r)) {