当前位置: 首页>>代码示例>>PHP>>正文


PHP Auth::isAdminOrDie方法代码示例

本文整理汇总了PHP中Auth::isAdminOrDie方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::isAdminOrDie方法的具体用法?PHP Auth::isAdminOrDie怎么用?PHP Auth::isAdminOrDie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Auth的用法示例。


在下文中一共展示了Auth::isAdminOrDie方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isDefaultUserIteractBlock

 private function isDefaultUserIteractBlock($id)
 {
     Auth::isAdminOrDie(App::$instance);
     if (in_array($id, [1])) {
         App::$instance->MQ->setMessage('Нелья редактировать системныe записи');
         ST::redirect("back");
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:8,代码来源:Initiators_controller.php

示例2: unmark

 public function unmark($caVksId)
 {
     Auth::isAdminOrDie(App::$instance);
     foreach (AdminCaNote::where('vks_id', $caVksId)->get() as $caVks) {
         $caVks->delete();
     }
     App::$instance->MQ->setMessage("У ВКС ЦА {$caVksId} удален флаг");
     ST::redirect('back');
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:9,代码来源:NotesCa_controller.php

示例3: delete

 public function delete($id)
 {
     Auth::isAdminOrDie(App::$instance);
     if ($id == 1) {
         App::$instance->MQ->setMessage("Это удалить нельзя, просто переименуйте как вам нужно");
         ST::redirect('back');
     }
     $department = Department::findorFail($id);
     $department->delete();
     App::$instance->MQ->setMessage("Успешно удалено");
     App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'Подразделение удалено' . $department->name);
     ST::redirectToRoute('Departments/index');
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:13,代码来源:Departments_controller.php

示例4: show

 public function show($rootId = 1)
 {
     Auth::isAdminOrDie(App::$instance);
     if (self::isContainer($rootId)) {
         $points = Attendance::where('parent_id', $rootId)->with('childs')->take($this->getQlimit(30))->skip($this->getQOffset())->orderBy('container', 'desc')->orderBy($this->getQOrder('name'), $this->getQVector('asc'))->get();
         $recordsCount = Attendance::where('parent_id', $rootId)->count();
         $breadCrumps = self::fullParentInfo($rootId);
         $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(30), 'route');
         $this->render('attendance/v2/show', compact('points', 'breadCrumps', 'pages'));
     } else {
         $this->error('404');
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:13,代码来源:AttendanceNew_controller.php

示例5: index

 public function index($eventType = false)
 {
     Auth::isAdminOrDie(App::$instance);
     if (!$eventType) {
         $logList = LogRecord::take($this->getQlimit(50))->skip($this->getQOffset())->orderBy($this->getQOrder(), $this->getQVector())->with("user")->get();
     } else {
         $logList = LogRecord::where('event_type', $eventType)->take($this->getQlimit(50))->skip($this->getQOffset())->orderBy($this->getQOrder(), $this->getQVector())->with("user")->get();
     }
     //define event type
     foreach ($logList as $log) {
         $log->humanized = new stdClass();
         $log->humanized->event_type = $this->defineLogType($log->event_type);
     }
     $eventType = $this->defineLogType($eventType);
     $recordsCount = LogRecord::all()->count();
     //pages
     $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(50), 'route');
     $this->render("logs/index", compact('logList', 'pages', 'eventType'));
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:19,代码来源:Log_controller.php

示例6: index

 public function index()
 {
     //take only today
     Auth::isAdminOrDie(App::$instance);
     $start = date_create()->setTime(0, 0);
     $end = date_create()->setTime(23, 59);
     $now = date_create();
     $calFeeder = new CalendarFeed_controller();
     $events = $calFeeder->feedInPeriod($start, $end);
     $sortedEvents = [];
     foreach ($events as $event) {
         if ($now < $event->start_date_time) {
             $sortedEvents['future'][] = $event;
         } elseif ($now > $event->end_date_time) {
             //                dump($now, date_create($event->end_date_time));
             $sortedEvents['past'][] = $event;
         } elseif ($now > $event->start_date_time && $now < $event->end_date_time) {
             $sortedEvents['now'][] = $event;
         }
     }
     if (isset($sortedEvents['future'])) {
         $sortedEvents['future']['html'] = App::$instance->twig->render('dashboards/event.twig', array('sortedEvents' => $sortedEvents['future'], 'coreHttpAddress' => HTTP_PATH, 'nodeHttpAddress' => NODE_HTTP_PATH));
     } else {
         $sortedEvents['future']['html'] = '<i>список пуст</i>';
     }
     //        dump($sortedEvents['past']);
     if (isset($sortedEvents['past'])) {
         $sortedEvents['past']['html'] = App::$instance->twig->render('dashboards/event.twig', array('sortedEvents' => $sortedEvents['past'], 'coreHttpAddress' => HTTP_PATH, 'nodeHttpAddress' => NODE_HTTP_PATH));
     } else {
         $sortedEvents['past']['html'] = '<i>список пуст</i>';
     }
     if (isset($sortedEvents['now'])) {
         $sortedEvents['now']['html'] = App::$instance->twig->render('dashboards/event.twig', array('sortedEvents' => $sortedEvents['now'], 'coreHttpAddress' => HTTP_PATH, 'nodeHttpAddress' => NODE_HTTP_PATH));
     } else {
         $sortedEvents['now']['html'] = '<i>список пуст</i>';
     }
     //        dump($sortedEvents);
     $this->render('dashboards/index', compact('sortedEvents'));
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:39,代码来源:Dashboard_controller.php

示例7: showOnly

<?php

Auth::isAdminOrDie(App::$instance);
ST::deployTemplate('heads/ui_timepicker.inc');
ST::setUserCss('attendance/style.css');
ST::setUserCss('attendance/manage-style.css');
RenderEngine::MenuChanger();
//dump($data['backPack']->parent_id);
//dump($data);
?>
<script>
    $(document).ready(function () {
        showOnly(".show10-1", 5);
        showOnly(".show10-2", 5);
    })
</script>
<div class="container">
    <div class="col-lg-1 col-sm-offset-2"><a class="btn btn-default"
                                             href="?route=AttendanceNew/show/<?php 
echo $data['backPack']->parent_id;
?>
">
            Назад</a></div>
    <div class="col-md-6 block-border-shadow-normal-padding left-border padding25">
        <h4>Редактировать точку/контейнер</h4>
        <hr>
        <div class="alert alert-danger">Свойтво "техническая поддержка" используется в экспериментальном режиме и пока нигде не используется</div>
        <form class="form-horizontal" method="post" action="?route=AttendanceNew/update/<?php 
echo $data['backPack']->id;
?>
">
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:31,代码来源:edit.php

示例8: storeOther

 public function storeOther()
 {
     Auth::isAdminOrDie(App::$instance);
     Token::checkToken();
     $xml = new SimpleXMLElement('<root/>');
     if ($this->request->request->has('option')) {
         foreach ($this->request->request->get('option') as $option) {
             if ($option['name'] == 'help-phone') {
                 $this->validator->validate([$option['description'] => [$option['value'], 'max(15)']]);
             } elseif (in_array($option['name'], ['attendance_strict', 'attendance_check_enable', 'notify_admins'])) {
                 $this->validator->validate([$option['description'] => [$option['value'], 'between(0,1)']]);
             } else {
                 $this->validator->validate([$option['description'] => [$option['value'], 'required']]);
             }
             //if no passes
             if (!$this->validator->passes()) {
                 $this->putUserDataAtBackPack($this->request);
                 App::$instance->MQ->setMessage($this->validator->errors()->all());
                 ST::redirect("back");
             }
             $srvXml = $xml->addChild('option');
             $srvXml->addAttribute('description', $option['description']);
             $srvXml->addAttribute('name', $option['name']);
             $srvXml->addAttribute('value', $option['value']);
         }
         $xml->asXML("config/other-cfg.xml");
         App::$instance->MQ->setMessage('Список обновлен');
         App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'изменены общие настройки');
     }
     ST::redirect("back");
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:31,代码来源:Settings_controller.php

示例9: isDefaultUserIteractBlock

 public static function isDefaultUserIteractBlock($id)
 {
     Auth::isAdminOrDie(App::$instance);
     if (in_array($id, [1])) {
         App::$instance->MQ->setMessage('Нелья редактировать системных пользователей');
         ST::redirect("back");
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:8,代码来源:User_controller.php

示例10: showLocalVks

 public function showLocalVks($caVksId)
 {
     Auth::isAdminOrDie(App::$instance);
     $vkses = Vks::with('participants')->where('link_ca_vks_id', $caVksId)->get();
     foreach ($vkses as $vks) {
         $this->humanize($vks);
     }
     $this->render('Vks/showLocalRelativeToCa', compact('vkses', 'caVksId'));
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:9,代码来源:Vks_controller.php


注:本文中的Auth::isAdminOrDie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。