From 3dd621713379be6ed5963e34c9e0ff4513fecc30 Mon Sep 17 00:00:00 2001 From: Gabriel Baker Date: Tue, 4 Jun 2013 19:54:56 +0100 Subject: [PATCH] Fixes #75 user entity not being in the registry --- PHPCI/Application.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PHPCI/Application.php b/PHPCI/Application.php index c0048adf..3378a050 100644 --- a/PHPCI/Application.php +++ b/PHPCI/Application.php @@ -10,6 +10,7 @@ namespace PHPCI; use b8; +use b8\Registry; use b8\Http\Response\RedirectResponse; use b8\View; @@ -33,8 +34,11 @@ class Application extends b8\Application $sessionAction = ($this->controllerName == 'Session' && in_array($this->action, array('login', 'logout'))); $externalAction = in_array($this->controllerName, array('Bitbucket', 'Github', 'BuildStatus')); $skipValidation = ($externalAction || $sessionAction); - + if($skipValidation || $this->validateSession()) { + if ( !empty($_SESSION['user']) ) { + Registry::getInstance()->set('user', $_SESSION['user']); + } parent::handleRequest(); } @@ -43,7 +47,7 @@ class Application extends b8\Application $view->content = $this->response->getContent(); $this->response->setContent($view->render()); } - + return $this->response; }