Skip to content

Commit a34eec7

Browse files
author
o
committed
fix selection of mode on login
When the User selects a mode on the login form (ie. setting horde_select_view), it gets always overwritten by 'auto'. The reason is that during login there is a cycle that leads to authentication being triggered twice. The culprit is the call to setAuth at https://github.com/horde/Core/blob/master/lib/Horde/Core/Auth/Application.php#L669 which ends up triggering a second authentication through $this->loadPrefs($this->getApp()); which in turn does not have access to the original $credentials array and then sets the view to the default value. This patch breaks the cycle, by preventing the second auth when the first one did not finish.
1 parent a1cb695 commit a34eec7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Horde/Registry.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,8 +2610,10 @@ public function setAuth($authId, $credentials, array $options = array())
26102610
$this->setAuthCredential($credentials, null, $app);
26112611

26122612
/* Reload preferences for the new user. */
2613-
unset($GLOBALS['prefs']);
2614-
$this->loadPrefs($this->getApp());
2613+
if ($this->getAuth() == $authId) {
2614+
unset($GLOBALS['prefs']);
2615+
$this->loadPrefs($this->getApp());
2616+
}
26152617

26162618
$this->setLanguageEnvironment(isset($options['language']) ? $this->preferredLang($options['language']) : null, $app);
26172619
}

0 commit comments

Comments
 (0)