Permalink
Browse files

fix for ticket #467 setting correct defaults when userModel is a plugin

model
  • Loading branch information...
1 parent 7337c12 commit 71e2fb533d51577382a1f2090599c1dd5316bfaf @ceeram ceeram committed Mar 19, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 cake/libs/controller/components/auth.php
@@ -448,12 +448,14 @@ function __setDefaults() {
trigger_error(__("Could not find \$userModel. Please set AuthComponent::\$userModel in beforeFilter().", true), E_USER_WARNING);
return false;
}
+ list($plugin, $model) = pluginSplit($this->userModel);
$defaults = array(
'loginAction' => array(
- 'controller' => Inflector::underscore(Inflector::pluralize($this->userModel)),
- 'action' => 'login'
+ 'controller' => Inflector::underscore(Inflector::pluralize($model)),
+ 'action' => 'login',
+ 'plugin' => $plugin,
),
- 'sessionKey' => 'Auth.' . $this->userModel,
+ 'sessionKey' => 'Auth.' . $model,
'logoutRedirect' => $this->loginAction,
'loginError' => __('Login failed. Invalid username or password.', true),
'authError' => __('You are not authorized to access that location.', true)

0 comments on commit 71e2fb5

Please sign in to comment.