當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。