本文整理汇总了PHP中fAuthorization::checkLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP fAuthorization::checkLoggedIn方法的具体用法?PHP fAuthorization::checkLoggedIn怎么用?PHP fAuthorization::checkLoggedIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fAuthorization
的用法示例。
在下文中一共展示了fAuthorization::checkLoggedIn方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requireEmailVerified
public static function requireEmailVerified()
{
if (!fAuthorization::checkLoggedIn()) {
return;
}
if (User::hasEmailVerified()) {
return;
}
fMessaging::create('warning', 'You are required to verify your email address before doing this action.');
Util::redirect('/email/verify');
}
示例2: render
protected function render($name)
{
// before output page
// if the visitor is anonymous
// do NOT send Set-Cookie to enable caching of Varnish
if (!fAuthorization::checkLoggedIn()) {
header_remove('Set-Cookie');
}
// then output page
profiler_render_begin();
include __DIR__ . '/../views/' . $name . '.php';
}
示例3: homework
public function homework()
{
if (fAuthorization::checkLoggedIn()) {
$this->cache_control('private', 5);
} else {
$this->cache_control('private', 10);
}
$conditions = array('title~' => array('homework', '作业'));
if (!User::can('view-any-report')) {
$conditions['visible='] = TRUE;
}
$this->reports = fRecordSet::build('Report', $conditions, array('id' => 'desc'));
$this->nav_class = 'homework';
$this->render('report/homework');
}
示例4: index
public function index()
{
if (fAuthorization::checkLoggedIn()) {
$this->cache_control('private', 2);
} else {
$this->cache_control('private', 5);
}
$top = fRequest::get('top', 'integer');
$this->owner = trim(fRequest::get('owner'));
$this->problem_id = trim(fRequest::get('problem'));
$this->language = trim(fRequest::get('language'));
$this->verdict = trim(fRequest::get('verdict'));
$this->page = fRequest::get('page', 'integer', 1);
$this->records = Record::find($top, $this->owner, $this->problem_id, $this->language, $this->verdict, $this->page);
$this->page_records = $this->records;
$common_url = SITE_BASE . "/status?owner={$this->owner}&problem={$this->problem_id}&language={$this->language}&verdict={$this->verdict}";
$this->top_url = "{$common_url}&top=";
$this->page_url = "{$common_url}&page=";
$this->nav_class = 'status';
$this->render('record/index');
}
示例5: show
public function show($id)
{
if (fAuthorization::checkLoggedIn()) {
$this->cache_control('private', 30);
} else {
$this->cache_control('private', 60);
}
try {
$this->problem = new Problem($id);
if ($this->problem->isSecretNow()) {
if (!User::can('view-any-problem')) {
throw new fAuthorizationException('Problem is secret now.');
}
}
$this->nav_class = 'problems';
$this->render('problem/show');
} catch (fExpectedException $e) {
fMessaging::create('warning', $e->getMessage());
fURL::redirect(Util::getReferer());
} catch (fUnexpectedException $e) {
fMessaging::create('error', $e->getMessage());
fURL::redirect(Util::getReferer());
}
}
示例6: array
<?php
$title = '微博';
$no_sidebar = true;
$stylesheets = array('bootstrap.min', 'tweets');
include __DIR__ . '/../layout/header.php';
?>
<div class="timeline feed-list">
<h1>最新微博</h1>
<?php
if (fAuthorization::checkLoggedIn()) {
?>
<center>
<form class="well form-search w500" action="<?php
echo SITE_BASE;
?>
/tweets" method="post" onsubmit="$.blockUI();">
<input type="hidden" name="quick" value="true"/>
<?php
if ($tweet_success = fMessaging::retrieve('success', 'create tweet')) {
?>
<div class="alert alert-success fade in">
<a class="close" data-dismiss="alert">×</a>
<?php
echo $tweet_success;
?>
</div>
<?php
}
?>
<?php
示例7: disableForAuthorized
/**
* Force disable all cache functions if the session is logged in as per
* fAuthorization::checkLoggedIn();
*/
public static function disableForAuthorized()
{
if (fAuthorization::checkLoggedIn()) {
static::$authorized_override = true;
}
}
示例8: elseif
<?php
if (fAuthorization::checkLoggedIn() and Registration::has(fAuthorization::getUserToken(), $this->report->getId())) {
?>
<button class="btn btn-mini btn-success disabled">已确认参赛</button>
<?php
} elseif ($this->report->isRegistrable()) {
?>
<form style="display:inline;margin:0" action="<?php
echo SITE_BASE;
?>
/contest/<?php
echo $this->report->getId();
?>
/register" method="POST">
<button type="submit" class="btn btn-mini btn-success">确认参赛</button>
</form>
<?php
}
示例9: testCheckLoggedIn2
public function testCheckLoggedIn2()
{
$this->assertEquals(FALSE, fAuthorization::checkLoggedIn());
fAuthorization::setAuthLevels(array('user' => 20, 'admin' => 50));
fAuthorization::setUserAuthLevel('admin');
$this->assertEquals(TRUE, fAuthorization::checkLoggedIn());
}
示例10: foreach
<th>作者</th>
<th>通过率 (通过/提交)</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->problems as $p) {
?>
<tr>
<td>
<?php
echo $p->getId();
?>
<?php
if (fAuthorization::checkLoggedIn() and User::hasAccepted($p)) {
?>
<i class="icon-ok"></i>
<?php
}
?>
</td>
<td><a href="<?php
echo SITE_BASE;
?>
/problem/<?php
echo $p->getId();
?>
"><?php
echo fHTML::encode($p->getTitle());
?>
示例11: isLoggedIn
/**
* Check if user is logged in. Uses own static variable, not fAuthorization.
*
* @return boolean True when the user is logged in
*/
public static function isLoggedIn()
{
return fAuthorization::checkLoggedIn();
}
示例12: requireProfile
public static function requireProfile()
{
if (fRequest::isGet() && fAuthorization::checkLoggedIn() && !self::hasProfile()) {
fURL::redirect(SITE_BASE . '/profiles/new');
}
}
示例13: foreach
<tr>
<?php
foreach ($this->board->getFooters() as $footer) {
?>
<th><?php
echo $footer;
?>
</th>
<?php
}
?>
</tr>
</tfoot>
</table>
<div class="alert alert-info">
Sort multiple columns simultaneously by
holding down the <strong>shift</strong> key and
clicking a second, third or even fourth column header!
</div>
<?php
}
$contest_id = $this->report->getId();
if ($this->report->getElapsedRatio() < 100) {
$meta_refresh = Variable::getInteger('status-refresh', 30);
}
if (fAuthorization::checkLoggedIn() and $this->report->isRunning()) {
$javascripts = array('jquery.tablesorter.min', 'board', 'ts-alert');
} else {
$javascripts = array('jquery.tablesorter.min', 'board');
}
include __DIR__ . '/../layout/footer.php';