Merge branch 'master' of https://github.com/kinncj/PHPCI into fix/standards_errors

This commit is contained in:
Dan Cryer 2013-05-17 16:14:08 +01:00
commit 71a01425cb
6 changed files with 8 additions and 7 deletions

View file

@ -33,7 +33,7 @@ class GenerateCommand extends Command
/** /**
* Generates Model and Store classes by reading database meta data. * 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 = new \b8\Database\CodeGenerator(\b8\Database::getConnection(), 'PHPCI', PHPCI_DIR . '/PHPCI/');
$gen->generateModels(); $gen->generateModels();

View file

@ -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. * 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: // Gather initial data from the user:
$dbHost = $this->ask('Enter your MySQL host: '); $dbHost = $this->ask('Enter your MySQL host: ');

View file

@ -32,7 +32,6 @@ class BuildController extends b8\Controller
public function view($buildId) public function view($buildId)
{ {
$build = $this->_buildStore->getById($buildId); $build = $this->_buildStore->getById($buildId);
$view = new b8\View('Build'); $view = new b8\View('Build');
$view->build = $build; $view->build = $build;
$view->data = $this->getBuildData($buildId); $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['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['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['finished'] = !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : null;
$data['plugins'] = $build->getPlugins();
return json_encode($data); return json_encode($data);
} }

View file

@ -107,6 +107,8 @@ class ProjectController extends b8\Controller
*/ */
public function add() public function add()
{ {
$_SESSION['github_token'] = isset($_SESSION['github_token']) ? $_SESSION['github_token'] : null;
if (!Registry::getInstance()->get('user')->getIsAdmin()) { if (!Registry::getInstance()->get('user')->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.'); throw new \Exception('You do not have permission to do that.');
} }
@ -151,7 +153,7 @@ class ProjectController extends b8\Controller
$view->project = null; $view->project = null;
$view->form = $form; $view->form = $form;
$view->key = $pub; $view->key = $pub;
$view->token = $_SESSION['github_token'] ? $_SESSION['github_token'] : null; $view->token = $_SESSION['github_token'];
return $view->render(); return $view->render();
} }

View file

@ -70,8 +70,8 @@ class SessionController extends b8\Controller
*/ */
public function logout() public function logout()
{ {
unset($_SESSION['user_id']); $_SESSION = array();
unset($_SESSION['github_token']); session_destroy();
header('Location: /'); header('Location: /');
die; die;
} }

View file

@ -25,7 +25,6 @@
</tr> </tr>
</thead> </thead>
<tbody id="plugins"> <tbody id="plugins">
<?php print $plugins; ?>
</tbody> </tbody>
</table> </table>
</div> </div>