Skip to content
Permalink
Browse files

optimization in AuthComponent class startup method

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
Robust Solution authored and markstory committed Jan 20, 2010
1 parent b1a0eb1 commit 16eaa990df971baca4664641dc8c6c92f9785d66
Showing with 3 additions and 4 deletions.
  1. +3 −4 cake/libs/controller/components/auth.php
@@ -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)
@@ -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])
@@ -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)

0 comments on commit 16eaa99

Please sign in to comment.
You can’t perform that action at this time.