本文整理匯總了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;
}
示例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']));
}
}
示例3: __construct
function __construct()
{
$this->user = Authentication::require_user();
}
示例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'])) {