diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-09 14:29:11 +0300 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-11-09 16:46:38 +0300 |
commit | fadb3a1e4a864361b3a15b0c0ba60c3d6035ff3b (patch) | |
tree | 63b7e07ce7db33174d61d9a50d1b755da0c813f0 /lib/Controller | |
parent | bd63790118ce09656c8c01cc3fe6fe70bb938c0d (diff) |
add a combobox instead of buttons to select the login method if more then 4 different IDPs are configured
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/SAMLController.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Controller/SAMLController.php b/lib/Controller/SAMLController.php index 150b1514..6cbb1317 100644 --- a/lib/Controller/SAMLController.php +++ b/lib/Controller/SAMLController.php @@ -366,18 +366,21 @@ class SAMLController extends Controller { */ public function selectUserBackEnd($redirectUrl) { - $loginUrls = []; + $attributes = ['loginUrls' => []]; if ($this->SAMLSettings->allowMultipleUserBackEnds()) { - $loginUrls['directLogin'] = [ + $attributes['loginUrls']['directLogin'] = [ 'url' => $this->getDirectLoginUrl($redirectUrl), 'display-name' => $this->l->t('Direct log in') ]; } - $loginUrls['ssoLogin'] = $this->getIdps($redirectUrl); + $attributes['loginUrls']['ssoLogin'] = $this->getIdps($redirectUrl); - return new Http\TemplateResponse($this->appName, 'selectUserBackEnd', $loginUrls, 'guest'); + $attributes['useCombobox'] = count($attributes['loginUrls']['ssoLogin']) > 4 ? true : false; + + + return new Http\TemplateResponse($this->appName, 'selectUserBackEnd', $attributes, 'guest'); } /** |