当前位置: 首页>>代码示例>>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;未经允许,请勿转载。