本文整理汇总了PHP中Sentinel::isAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentinel::isAdmin方法的具体用法?PHP Sentinel::isAdmin怎么用?PHP Sentinel::isAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentinel
的用法示例。
在下文中一共展示了Sentinel::isAdmin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$return['b'] = $r;
break;
/*
|--------------------------------------------------------------------------
| Anonymous save
|--------------------------------------------------------------------------
|
*/
/*
|--------------------------------------------------------------------------
| Anonymous save
|--------------------------------------------------------------------------
|
*/
case 'anonymous_save':
if (!Sentinel::isAdmin()) {
$return['error'] = 'vaffanculo';
break;
}
unset($_POST['csrf_token']);
unset($_POST['action']);
$logfiles = $_POST;
foreach ($logfiles as $fileid => $access) {
if (substr($fileid, 0, 2) === 'f-') {
Sentinel::setLogAnonymous(substr($fileid, 2), (int) $access === 1);
}
}
Sentinel::save();
break;
/*
|--------------------------------------------------------------------------
示例2: __
if (upgrade_is_composer()) {
$upgrade['alert'] .= __('Simply <code>composer update</code> in the installation directory');
$upgrade['alert'] .= '<br/>';
$upgrade['alert'] .= '<br/><pre id="composercontent">cd ' . escapeshellarg(realpath(PML_BASE . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR)) . '; composer update</pre>';
$upgrade['alert'] .= '<div id="changelog" class="panel-collapse collapse"><br/><div class="panel-body panel panel-default">' . $html . '</div></div>';
$upgrade['alert'] .= '<div class="row">';
$upgrade['alert'] .= '<div class="col-xs-6 text-left">';
$upgrade['alert'] .= '<button id="composercopy" class="btn btn-xs btn-primary clipboard"><span class="glyphicon glyphicon-cloud-download"></span> ' . __("Copy to clipboard") . '</button>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '<div class="col-xs-6 text-right">';
$upgrade['alert'] .= '<button id="upgradestop" data-version="' . $upgrade['to'] . '" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-ok"></span> ' . __("Skip this upgrade") . '</button>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '<script>clipboard_enable("#composercopy","#composercontent" , "right" , "' . __('Command copied!') . '");</script>';
} else {
if (AUTO_UPGRADE === false || Sentinel::isAuthSet() && !Sentinel::isAdmin(Sentinel::getCurrentUsername())) {
$upgrade['alert'] .= sprintf(__('Simply <code>git pull</code> in your directory or follow instructions %shere%s'), '<a href="' . UPGRADE_MANUALLY_URL . '" target="doc" class="alert-link">', '</a>');
$upgrade['alert'] .= '<br/>';
$upgrade['alert'] .= '<br/><pre id="gitcontent">cd ' . PML_BASE . '; git pull</pre>';
$upgrade['alert'] .= '<div id="changelog" class="panel-collapse collapse"><br/><div class="panel-body panel panel-default">' . $html . '</div></div>';
$upgrade['alert'] .= '<div class="row">';
$upgrade['alert'] .= '<div class="col-xs-6 text-left">';
$upgrade['alert'] .= '<button id="gitcopy" class="btn btn-xs btn-primary clipboard"><span class="glyphicon glyphicon-cloud-download"></span> ' . __("Copy to clipboard") . '</button>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '<div class="col-xs-6 text-right">';
$upgrade['alert'] .= '<button id="upgradestop" data-version="' . $upgrade['to'] . '" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-ok"></span> ' . __("Skip this upgrade") . '</button>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '</div>';
$upgrade['alert'] .= '<script>clipboard_enable("#gitcopy","#gitcontent" , "right" , "' . __('Command copied!') . '");</script>';
} else {
if (upgrade_is_git()) {