From a071ef19ab37ed598d18caaaec35558f42be2518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinn=20Coelho=20Juli=C3=A3o?= Date: Thu, 16 May 2013 15:43:17 -0400 Subject: [PATCH 1/4] Fixed Strict Standards notices Fixed Strict Standard notice for PHPCI/Command/GenerateCommand.php Fixed Strict Standard notice for PHPCI/Command/InstallCommand.php --- PHPCI/Command/GenerateCommand.php | 2 +- PHPCI/Command/InstallCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PHPCI/Command/GenerateCommand.php b/PHPCI/Command/GenerateCommand.php index 35188c3c..54a729ca 100644 --- a/PHPCI/Command/GenerateCommand.php +++ b/PHPCI/Command/GenerateCommand.php @@ -33,7 +33,7 @@ class GenerateCommand extends Command /** * Generates Model and Store classes by reading database meta data. */ - protected function execute() + protected function execute(InputInterface $input, OutputInterface $output) { $gen = new \b8\Database\CodeGenerator(\b8\Database::getConnection(), 'PHPCI', PHPCI_DIR . '/PHPCI/'); $gen->generateModels(); diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php index 73d962c7..2549e5cc 100644 --- a/PHPCI/Command/InstallCommand.php +++ b/PHPCI/Command/InstallCommand.php @@ -35,7 +35,7 @@ class InstallCommand extends Command /** * Installs PHPCI - Can be run more than once as long as you ^C instead of entering an email address. */ - protected function execute() + protected function execute(InputInterface $input, OutputInterface $output) { // Gather initial data from the user: $dbHost = $this->ask('Enter your MySQL host: '); From 3f9b678d2b3486e7117aff9da8f8226ebb4d0abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinn=20Coelho=20Juli=C3=A3o?= Date: Thu, 16 May 2013 18:06:01 -0400 Subject: [PATCH 2/4] Validate if github_token exists Validate if the github_token session key exists before call it --- PHPCI/Controller/ProjectController.php | 4 +++- PHPCI/Controller/SessionController.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 092b1276..da0ffe77 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -107,6 +107,8 @@ class ProjectController extends b8\Controller */ public function add() { + $_SESSION['github_token'] = isset($_SESSION['github_token']) ? $_SESSION['github_token'] : null; + if (!Registry::getInstance()->get('user')->getIsAdmin()) { throw new \Exception('You do not have permission to do that.'); } @@ -151,7 +153,7 @@ class ProjectController extends b8\Controller $view->project = null; $view->form = $form; $view->key = $pub; - $view->token = $_SESSION['github_token'] ? $_SESSION['github_token'] : null; + $view->token = $_SESSION['github_token']; return $view->render(); } diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php index 7e806a21..de877e49 100644 --- a/PHPCI/Controller/SessionController.php +++ b/PHPCI/Controller/SessionController.php @@ -70,8 +70,8 @@ class SessionController extends b8\Controller */ public function logout() { - unset($_SESSION['user_id']); - unset($_SESSION['github_token']); + $_SESSION = array(); + session_destroy(); header('Location: /'); die; } From e037f063aa7954395fbb7fc1d9b9b8fe60b3313c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinn=20Coelho=20Juli=C3=A3o?= Date: Thu, 16 May 2013 18:21:51 -0400 Subject: [PATCH 3/4] Added missing $plugins to the view added $view->plugins --- PHPCI/Controller/BuildController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index c590f4f8..309fa6f9 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -32,10 +32,10 @@ class BuildController extends b8\Controller public function view($buildId) { $build = $this->_buildStore->getById($buildId); - $view = new b8\View('Build'); $view->build = $build; $view->data = $this->getBuildData($buildId); + $view->plugins = $build->getPlugins(); return $view->render(); } @@ -62,6 +62,7 @@ class BuildController extends b8\Controller $data['created'] = !is_null($build->getCreated()) ? $build->getCreated()->format('Y-m-d H:i:s') : null; $data['started'] = !is_null($build->getStarted()) ? $build->getStarted()->format('Y-m-d H:i:s') : null; $data['finished'] = !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : null; + $data['plugins'] = $build->getPlugins(); return json_encode($data); } From 3de71b2155db08f59c97784e0356012226e650d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinn=20Coelho=20Juli=C3=A3o?= Date: Fri, 17 May 2013 10:08:15 -0400 Subject: [PATCH 4/4] Removed from view once it's loaded by AJAX request --- PHPCI/Controller/BuildController.php | 1 - PHPCI/View/Build.phtml | 1 - 2 files changed, 2 deletions(-) diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index 309fa6f9..00c9fb90 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -35,7 +35,6 @@ class BuildController extends b8\Controller $view = new b8\View('Build'); $view->build = $build; $view->data = $this->getBuildData($buildId); - $view->plugins = $build->getPlugins(); return $view->render(); } diff --git a/PHPCI/View/Build.phtml b/PHPCI/View/Build.phtml index 15ad8304..9f4effad 100644 --- a/PHPCI/View/Build.phtml +++ b/PHPCI/View/Build.phtml @@ -25,7 +25,6 @@ -