From 757a82c26f4e5bd31144443eda4466eb83d19ee5 Mon Sep 17 00:00:00 2001 From: Gabriel Baker Date: Tue, 4 Jun 2013 20:17:17 +0100 Subject: [PATCH] removed deprecated registry and use session --- PHPCI/Application.php | 4 ---- PHPCI/Controller/BuildController.php | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/PHPCI/Application.php b/PHPCI/Application.php index 3378a050..9e555d5c 100644 --- a/PHPCI/Application.php +++ b/PHPCI/Application.php @@ -10,7 +10,6 @@ namespace PHPCI; use b8; -use b8\Registry; use b8\Http\Response\RedirectResponse; use b8\View; @@ -36,9 +35,6 @@ class Application extends b8\Application $skipValidation = ($externalAction || $sessionAction); if($skipValidation || $this->validateSession()) { - if ( !empty($_SESSION['user']) ) { - Registry::getInstance()->set('user', $_SESSION['user']); - } parent::handleRequest(); } diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index 21de59c9..b41287aa 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -86,10 +86,10 @@ class BuildController extends \PHPCI\Controller */ public function delete($buildId) { - if (!Registry::getInstance()->get('user')->getIsAdmin()) { + if (empty($_SESSION['user']) || !$_SESSION['user']->getIsAdmin()) { throw new \Exception('You do not have permission to do that.'); } - + $build = $this->_buildStore->getById($buildId); $this->_buildStore->delete($build);