Merging fixes for strict standards errors. Closes #44

This commit is contained in:
Dan Cryer 2013-05-17 16:24:17 +01:00
parent 71a01425cb
commit b9415316d4
3 changed files with 4 additions and 5 deletions

View file

@ -61,7 +61,6 @@ 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,8 +107,6 @@ 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.');
}
@ -175,9 +173,11 @@ class ProjectController extends b8\Controller
*/
protected function handleGithubResponse()
{
$github = \b8\Registry::getInstance()->get('github_app');
$github = \b8\Registry::getInstance()->get('github_app');
$code = $this->getParam('code', null);
$_SESSION['github_token'] = null;
if (!is_null($code)) {
$http = new \b8\HttpClient();
$url = 'https://github.com/login/oauth/access_token';

View file

@ -31,7 +31,7 @@ class Project extends ProjectBase
}
$order = array('id' => 'DESC');
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, $start, array(), $order);
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 0, array(), $order);
if (is_array($builds['items']) && count($builds['items'])) {
$latest = array_shift($builds['items']);