-
Notifications
You must be signed in to change notification settings - Fork 27
fix(auth): IMP server selector missing on login page unless auth driver is 'application' #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: FRAMEWORK_6_0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -368,6 +368,20 @@ function _addAnchor($url, $type, $vars, $url_anchor = null) | |
| } catch (Horde_Exception $e) { | ||
| } | ||
|
|
||
| // IMP declares extra login params (e.g. server selector) via the | ||
| // 'loginparams' auth capability. Merge these independently of the | ||
| // primary Horde auth driver. | ||
| try { | ||
| $impAuth = $injector->getInstance('Horde_Core_Factory_Auth')->create('imp'); | ||
| if ($impAuth->hasCapability('loginparams')) { | ||
| $impResult = $impAuth->getLoginParams(); | ||
| $loginparams = array_filter(array_merge($loginparams, $impResult['params'] ?? [])); | ||
| $js_code = array_merge($js_code, $impResult['js_code'] ?? []); | ||
| $js_files = array_merge($js_files, $impResult['js_files'] ?? []); | ||
| } | ||
| } catch (\Throwable $e) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Catching Throwable is way too broad.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like Horde_Exception|Horde\Exception\Throwable |
||
| } | ||
|
|
||
| /* If we currently are authenticated, and are not trying to authenticate to | ||
| * an application, redirect to initial page. This is done in index.php. | ||
| * If we are trying to authenticate to an application, but don't have to, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,23 @@ public function buildLoginFormData( | |
| // No backend-specific params | ||
| } | ||
|
|
||
| // IMP declares extra login params (e.g. server selector) via the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing IMP specific belongs here. |
||
| // 'loginparams' auth capability. Merge these independently of the | ||
| // primary Horde auth driver, so the server list still appears when | ||
| // Horde authenticates via LDAP/etc. rather than the 'application' | ||
| // driver pointed at IMP. | ||
| try { | ||
| $impAuth = $this->injector->getInstance('Horde_Core_Factory_Auth')->create('imp'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generalize to something like: foreach ($this->registry->listApps() as $app) { try { $appAuth = $this->injector->getInstance('Horde_Core_Factory_Auth')->create($app); |
||
| if ($impAuth->hasCapability('loginparams')) { | ||
| $impResult = $impAuth->getLoginParams(); | ||
| $loginparams = array_filter(array_merge($loginparams, $impResult['params'] ?? [])); | ||
| $jsCode = array_merge($jsCode, $impResult['js_code'] ?? []); | ||
| $jsFiles = array_merge($jsFiles, $impResult['js_files'] ?? []); | ||
| } | ||
| } catch (\Throwable $e) { | ||
| // IMP not installed, or no extra login params | ||
| } | ||
|
|
||
| // Mode selector | ||
| $modeSelector = ''; | ||
| if (!empty($this->conf['user']['select_view'])) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing IMP specific belongs here