Fix for auth component userModel with plugins. Fixes #799

This commit is contained in:
Kyle Robinson Young 2010-06-07 17:08:04 -07:00 committed by mark_story
parent ccd036eed0
commit a9fa7ac240
2 changed files with 11 additions and 1 deletions

View file

@ -469,7 +469,7 @@ class AuthComponent extends Object {
'loginAction' => array(
'controller' => Inflector::underscore(Inflector::pluralize($model)),
'action' => 'login',
'plugin' => $plugin,
'plugin' => Inflector::underscore($plugin),
),
'sessionKey' => 'Auth.' . $model,
'logoutRedirect' => $this->loginAction,

View file

@ -1431,6 +1431,16 @@ class AuthTest extends CakeTestCase {
$this->assertEqual($user, $expected);
$sessionKey = $this->Controller->Auth->sessionKey;
$this->assertEqual('Auth.TestPluginAuthUser', $sessionKey);
$this->Controller->Auth->loginAction = null;
$this->Controller->Auth->__setDefaults();
$loginAction = $this->Controller->Auth->loginAction;
$expected = array(
'controller' => 'test_plugin_auth_users',
'action' => 'login',
'plugin' => 'test_plugin'
);
$this->assertEqual($loginAction, $expected);
// Reverting changes
Cache::delete('object_map', '_cake_core_');