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: '); diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index c590f4f8..00c9fb90 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -32,7 +32,6 @@ 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); @@ -62,6 +61,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); } 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; } 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 @@ -