Skip to content

Commit

Permalink
optimization in AuthComponent class startup method
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
Robust Solution authored and markstory committed Jan 26, 2010
1 parent b1a0eb1 commit 16eaa99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cake/libs/controller/components/auth.php
Expand Up @@ -262,10 +262,6 @@ function initialize(&$controller) {
* @access public
*/
function startup(&$controller) {
$methods = array_flip($controller->methods);
$action = strtolower($controller->params['action']);
$allowedActions = array_map('strtolower', $this->allowedActions);

$isErrorOrTests = (
strtolower($controller->name) == 'cakeerror' ||
(strtolower($controller->name) == 'tests' && Configure::read() > 0)
Expand All @@ -274,6 +270,8 @@ function startup(&$controller) {
return true;
}

$methods = array_flip($controller->methods);
$action = strtolower($controller->params['action']);
$isMissingAction = (
$controller->scaffold === false &&
!isset($methods[$action])
Expand All @@ -296,6 +294,7 @@ function startup(&$controller) {
$url = Router::normalize($url);
$loginAction = Router::normalize($this->loginAction);

$allowedActions = array_map('strtolower', $this->allowedActions);
$isAllowed = (
$this->allowedActions == array('*') ||
in_array($action, $allowedActions)
Expand Down

0 comments on commit 16eaa99

Please sign in to comment.