diff --git a/lib/Controller/SAMLController.php b/lib/Controller/SAMLController.php index 90b6a96..bdeae2c 100644 --- a/lib/Controller/SAMLController.php +++ b/lib/Controller/SAMLController.php @@ -319,8 +319,14 @@ class SAMLController extends Controller { */ public function selectUserBackEnd($redirectUrl) { $loginUrls = [ - 'directLogin' => $this->getDirectLoginUrl(), - 'ssoLogin' => $this->getSSOUrl($redirectUrl) + 'directLogin' => [ + 'url' => $this->getDirectLoginUrl(), + 'display-name' => $this->l->t('Direct log in') + ], + 'ssoLogin' => [ + 'url' => $this->getSSOUrl($redirectUrl), + 'display-name' => $this->getSSODisplayName(), + ] ]; return new Http\TemplateResponse($this->appName, 'selectUserBackEnd', $loginUrls, 'guest'); } @@ -352,6 +358,20 @@ class SAMLController extends Controller { } + /** + * return the display name of the SSO identity provider + * + * @return string + */ + protected function getSSODisplayName() { + $displayName = $this->config->getAppValue('user_saml', 'general-idp0_display_name'); + if (empty($displayName)) { + $displayName = $this->l->t('SSO & SAML log in'); + } + + return $displayName; + } + /** * get SSO URL * diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 7bb9395..7ae9e9c 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -77,6 +77,11 @@ class Admin implements ISettings { 'lowercaseUrlencoding' => $this->l10n->t('ADFS URL-Encodes SAML data as lowercase, and the toolkit by default uses uppercase. Enable for ADFS compatibility on signature verification.'), ]; $generalSettings = [ + 'idp0_display_name' => [ + 'text' => $this->l10n->t('Optional display name of the identity provider (default: "SSO & SAML log in")'), + 'type' => 'line', + 'required' => false, + ], 'uid_mapping' => [ 'text' => $this->l10n->t('Attribute to map the UID to.'), 'type' => 'line', diff --git a/templates/selectUserBackEnd.php b/templates/selectUserBackEnd.php index 646284e..4c205a9 100644 --- a/templates/selectUserBackEnd.php +++ b/templates/selectUserBackEnd.php @@ -10,11 +10,11 @@ style('user_saml', 'selectUserBackEnd');