Anonymous user access rank wiring

This commit is contained in:
Marcin Kurczewski 2013-10-05 20:00:13 +02:00
parent c905f1d7dd
commit 377bdcf7c9
2 changed files with 5 additions and 3 deletions

View file

@ -14,8 +14,10 @@ class Bootstrap
}
if (empty($this->context->user))
{
#todo: construct anonymous user
$this->context->user = null;
$dummy = R::dispense('user');
$dummy->name = 'Anonymous';
$dummy->access_rank = AccessRank::Anonymous;
$this->context->user = $dummy;
}
}

View file

@ -21,7 +21,7 @@
</form>
</li>
<li>
<?php if (empty($this->context->user)): ?>
<?php if (!$this->context->loggedIn): ?>
<a href="<?php echo \Chibi\UrlHelper::route('auth', 'login') ?>">Login</a>
&nbsp;or&nbsp;
<a href="<?php echo \Chibi\UrlHelper::route('auth', 'register') ?>">register</a>