本文整理汇总了PHP中ST::routeToErrorPage方法的典型用法代码示例。如果您正苦于以下问题:PHP ST::routeToErrorPage方法的具体用法?PHP ST::routeToErrorPage怎么用?PHP ST::routeToErrorPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ST
的用法示例。
在下文中一共展示了ST::routeToErrorPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAdminOrDie
static function isAdminOrDie($init)
{
if ($init->user->isLogged && ($init->user->role == ROLE_ADMIN || $init->user->role == ROLE_ADMIN_MODERATOR)) {
return true;
} else {
App::$instance->log->logWrite(LOG_SECURITY, "Restricted access: Try to enter admin only allowed zone");
ST::routeToErrorPage('only-admin');
exit;
}
}
示例2: checkToken
static function checkToken()
{
return true;
if (!isset($_SESSION['token']) || is_null($_SESSION['token']) || is_null(Request::createFromGlobals()->get('csrf_token'))) {
throw new RuntimeException("Bad Token initialization");
}
$flag = false;
foreach ($_SESSION['token'] as $key => $token) {
if ($token === Request::createFromGlobals()->get('csrf_token')) {
$flag = true;
//drop this token
unset($_SESSION['token'][$key]);
}
}
if ($flag) {
return true;
} else {
ST::routeToErrorPage('bad-token');
}
}
示例3: requiredCapcha
<?php
ST::deployTemplate('heads/ui_timepicker.inc');
$init = App::get_instance();
RenderEngine::MenuChanger();
if (!isset($valid) || !$valid) {
ST::routeToErrorPage('500');
}
?>
<!--<script>-->
<!-- $(document).ready(function () {-->
<!-- requiredCapcha("#submit");-->
<!-- })-->
<!--</script>-->
<div class='container'>
<div class=' col-md-offset-2 col-md-8 block-border-shadow'>
<div class='col-md-offset-3 col-md-9'>
<form class='form-horizontal' id="form1" method='post'
action="<?php
echo ST::route("AuthNew/processResetPwd/" . $user->id);
?>
">
<div class='form-group'>
<h4>Введите новый пароль для учетной записи <br><?php
echo $user->login;
?>
</h4>
<hr>
</div>
示例4: makeStackName
public static function makeStackName($stackType = STACK_SINGLE)
{
Auth::isLoggedOrDie(App::$instance);
$result = '';
try {
$result = sha1($stackType . date_create()->format("Y-m-d") . App::$instance->user->login . App::$instance->main->appkey);
} catch (Exception $e) {
ST::routeToErrorPage('500');
}
return $result;
}