mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fix for auth component userModel with plugins. Fixes #799
This commit is contained in:
parent
ccd036eed0
commit
a9fa7ac240
2 changed files with 11 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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_');
|
||||
|
|
Loading…
Add table
Reference in a new issue