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.
*/
protected function execute()
protected function execute(InputInterface $input, OutputInterface $output)
{
$gen = new \b8\Database\CodeGenerator(\b8\Database::getConnection(), 'PHPCI', PHPCI_DIR . '/PHPCI/');
$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.
*/
protected function execute()
protected function execute(InputInterface $input, OutputInterface $output)
{
// Gather initial data from the user:
$dbHost = $this->ask('Enter your MySQL host: ');

View file

@ -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);
}

View file

@ -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();
}

View file

@ -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;
}

View file

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