fix(auth): IMP server selector missing on login page unless auth driver is 'application'#136
Open
jcdelepine wants to merge 1 commit into
Open
Conversation
LoginService::buildLoginFormData() and login.php's equivalent inline code only resolved extra login form fields (e.g. IMP's server selector) through the primary Horde auth driver instance. With auth.driver = 'application' pointed at imp, this worked because 'horde' auth delegates directly to 'imp'. With any other driver (LDAP, SQL, etc.), IMP's authLoginParams() was never consulted, silently dropping the server selector even when $conf['server']['server_list'] = 'shown'. Both login.php and LoginService now additionally resolve IMP's login params via the new 'loginparams' auth capability (see horde/imp), independently of which driver authenticates the user to Horde itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
When multiple IMAP backends are configured in
backends.phpwith$conf['server']['server_list'] = 'shown'(imp), the server selector dropdown never appears on the login page — unless the Horde auth driver is specificallyapplicationpointed atimp.Root cause
LoginService::buildLoginFormData()(andlogin.php's equivalent inline code) resolves extra login form fields via$auth->getLoginParams(), using the auth driver instance for the'horde'app only.IMP_Application::authLoginParams()— which builds the server selector — is only reachable through this path when$conf['auth']['driver'] = 'application'withparams.app = 'imp', since in that configuration'horde'auth delegates directly to'imp'.With any other driver (LDAP, SQL, etc.), IMP's login params are never consulted at all, silently dropping the server selector.
Fix
Add a
'loginparams'auth capability, declared byIMP_Application::$auth(mirroring the existing'add','transparent', etc. capabilities).LoginService/login.phpnow additionally resolve IMP's login params via this capability, independently of which driver authenticates the user to Horde itself.Depends on the companion change in horde/imp declaring the
'loginparams'capability.Testing
Verified the server selector now appears on both
/login.phpand the responsive/auth/loginroute withauth.driver = ldapand multiple non-disabled backends inbackends.php.