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)) if (empty($this->context->user))
{ {
#todo: construct anonymous user $dummy = R::dispense('user');
$this->context->user = null; $dummy->name = 'Anonymous';
$dummy->access_rank = AccessRank::Anonymous;
$this->context->user = $dummy;
} }
} }

View file

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