Skip to content

Commit

Permalink
Move error disabling to the error controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 19, 2012
1 parent fec6c1c commit f9ddc9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
9 changes: 6 additions & 3 deletions lib/Cake/Controller/CakeErrorController.php
Expand Up @@ -54,12 +54,15 @@ public function __construct($request = null, $response = null) {
$this->components[] = 'RequestHandler';
}
$this->constructClasses();
if ($this->Components->enabled('Auth')) {
$this->Components->disable('Auth');
}
if ($this->Components->enabled('Security')) {
$this->Components->disable('Security');
}
$this->startupProcess();

$this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
if (isset($this->RequestHandler)) {
$this->RequestHandler->startup($this);
}
}

/**
Expand Down
4 changes: 0 additions & 4 deletions lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -264,10 +264,6 @@ public function initialize(Controller $controller) {
* @return boolean
*/
public function startup(Controller $controller) {
if ($controller->name == 'CakeError') {
return true;
}

$methods = array_flip(array_map('strtolower', $controller->methods));
$action = strtolower($controller->request->params['action']);

Expand Down
4 changes: 0 additions & 4 deletions lib/Cake/Controller/Component/SecurityComponent.php
Expand Up @@ -205,10 +205,6 @@ class SecurityComponent extends Component {
* @return void
*/
public function startup(Controller $controller) {
if ($controller->name == 'CakeError') {
return true;
}

$this->request = $controller->request;
$this->_action = $this->request->params['action'];
$this->_methodsRequired($controller);
Expand Down

0 comments on commit f9ddc9c

Please sign in to comment.