當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sentinel::isAdmin方法代碼示例

本文整理匯總了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;
     /*
     |--------------------------------------------------------------------------
開發者ID:expressive-analytics,項目名稱:docker-dt-standard.php,代碼行數:31,代碼來源:users.pml.php

示例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>&nbsp;' . __("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>&nbsp;' . __("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>&nbsp;' . __("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>&nbsp;' . __("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()) {
開發者ID:abhijith444,項目名稱:enroll,代碼行數:31,代碼來源:upgrade.pml.php


注:本文中的Sentinel::isAdmin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。