From 377bdcf7c986b28f7946bdbc7b7a98afe2b8111c Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 5 Oct 2013 20:00:13 +0200 Subject: [PATCH] Anonymous user access rank wiring --- src/Bootstrap.php | 6 ++++-- src/Views/layout-normal.phtml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Bootstrap.php b/src/Bootstrap.php index e1a4310d..7840fbce 100644 --- a/src/Bootstrap.php +++ b/src/Bootstrap.php @@ -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; } } diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index 8bbc99ba..6db664c7 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -21,7 +21,7 @@
  • - context->user)): ?> + context->loggedIn): ?> Login  or  register