From b2139cf51f67839f703ab8d1f6baf11214d8201a Mon Sep 17 00:00:00 2001 From: o Date: Wed, 1 Apr 2020 10:18:06 +0200 Subject: [PATCH] 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. The fix is to set the view first. --- lib/Horde/Core/Auth/Application.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Horde/Core/Auth/Application.php b/lib/Horde/Core/Auth/Application.php index 17aef637d..c32a5a6f4 100644 --- a/lib/Horde/Core/Auth/Application.php +++ b/lib/Horde/Core/Auth/Application.php @@ -666,17 +666,17 @@ protected function _setAuth() return false; } + /* Only set the view mode on initial authentication */ + if (!$GLOBALS['session']->exists('horde', 'view')) { + $this->_setView(); + } + $registry->setAuth($userId, $credentials, array( 'app' => $this->_app, 'change' => $this->getCredential('change'), 'language' => $language )); - /* Only set the view mode on initial authentication */ - if (!$GLOBALS['session']->exists('horde', 'view')) { - $this->_setView(); - } - if ($this->_base && isset($GLOBALS['notification']) && ($expire = $this->_base->getCredential('expire'))) {