本文整理汇总了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'])) {