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


PHP Authentication::require_user方法代码示例

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


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

示例1: require_admin

 static function require_admin()
 {
     $user = Authentication::require_user();
     if (!$user->is_admin) {
         ErrorPage::die_fancy(new NotAuthorizedException());
     }
     return $user;
 }
开发者ID:jlsa,项目名称:justitia,代码行数:8,代码来源:Authentication.php

示例2: __construct

 function __construct()
 {
     // find active entity
     $user = Authentication::require_user();
     $this->entity = Entity::get(@$_SERVER['PATH_INFO'], !$user->is_admin);
     // Redjudge all
     if (isset($_REQUEST['rejudge_all']) and Authentication::is_admin()) {
         Log::info("Requested redjudgement for all submissions in this entity", $this->entity->path());
         foreach ($this->entity->all_submissions() as $subm) {
             $subm->rejudge();
         }
         Util::redirect(str_replace('rejudge_all=1', '', $_SERVER['REQUEST_URI']));
     }
 }
开发者ID:jlsa,项目名称:justitia,代码行数:14,代码来源:PageWithEntity.php

示例3: __construct

 function __construct()
 {
     $this->user = Authentication::require_user();
 }
开发者ID:jlsa,项目名称:justitia,代码行数:4,代码来源:user_settings.php

示例4: title

<?php

require_once '../lib/bootstrap.inc';
// -----------------------------------------------------------------------------
// Add group user and redirect
// -----------------------------------------------------------------------------
Authentication::require_user();
if (isset($_REQUEST['add'])) {
    UserGroup::add_id(intval($_REQUEST['add']));
    Util::redirect(@$_REQUEST['redirect']);
}
// -----------------------------------------------------------------------------
// Page for picking user
// -----------------------------------------------------------------------------
class View extends Template
{
    function title()
    {
        return "Add user to group";
    }
    function write_user_list()
    {
        $this->write_block_begin('User list');
        $this->write_form_begin('user_group_add.php', 'get');
        $this->write_form_preserve('redirect');
        echo '<label>Search for users: ';
        $this->write_form_field('text', 'user_filter', @$_REQUEST['user_filter']);
        echo '</label>';
        $this->write_form_end('Show');
        echo '<small>Make sure your lab partner has logged in with Justitia at least once.</small>';
        if (!isset($_REQUEST['user_filter'])) {
开发者ID:jlsa,项目名称:justitia,代码行数:31,代码来源:user_group_add.php


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