Skip to content

Commit

Permalink
Changed spaces to tabs in AppController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
m0hamed committed Jul 30, 2013
1 parent 69b426b commit 942fb1c
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions app/Controller/AppController.php
@@ -1,4 +1,5 @@
<?php
/* vim: set expandtab sw=2 ts=2 sts=2: */
/**
* Application level Controller
*
Expand All @@ -14,11 +15,11 @@
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Controller
* @since CakePHP(tm) v 0.2.9
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Controller
* @since CakePHP(tm) v 0.2.9
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('Controller', 'Controller');
App::uses('Developer', 'Model');
Expand All @@ -33,39 +34,41 @@
* @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
*/
class AppController extends Controller {
public $components = array(
'DebugKit.Toolbar',
'Session',
);
public $uses = array('Developer');

public function beforeFilter() {
$params = $this->params->params;
$controller = $params["controller"];
$action = $params["action"];
public $components = array(
'DebugKit.Toolbar',
'Session',
);

if($params["controller"] === "reports") {
$this->set('navigation_class', "active");
} else {
$this->set('navigation_class', "");
}
public $uses = array('Developer');

if($this->Session->read('Developer.id')) {
$current_developer = $this->Developer->
findById($this->Session->read('Developer.id'));
$current_developer = Sanitize::clean($current_developer);
public function beforeFilter() {
$params = $this->params->params;
$controller = $params["controller"];
$action = $params["action"];

$this->set('current_developer', $current_developer["Developer"]);
$this->set('developer_signed_in', true);
} else {
$this->set('developer_signed_in', false);
if($params["controller"] === "reports") {
$this->set('navigation_class', "active");
} else {
$this->set('navigation_class', "");
}

if($controller !== "pages" && $controller !== "developers" &&
!($action === "submit" && $controller === "reports")) {
$this->Session->setFlash("You need to be signed in to do this", "default",
array("class" => "alert alert-error"));
$this->redirect("/");
}
}
}
if($this->Session->read('Developer.id')) {
$current_developer = $this->Developer->
findById($this->Session->read('Developer.id'));
$current_developer = Sanitize::clean($current_developer);

$this->set('current_developer', $current_developer["Developer"]);
$this->set('developer_signed_in', true);
} else {
$this->set('developer_signed_in', false);

if($controller !== "pages" && $controller !== "developers" &&
!($action === "submit" && $controller === "reports")) {
$this->Session->setFlash("You need to be signed in to do this", "default",
array("class" => "alert alert-error"));
$this->redirect("/");
}
}
}
}

0 comments on commit 942fb1c

Please sign in to comment.