Skip to content

Commit ebaea08

Browse files
committed
fix(UI): set value to the require_provisioned_account option also in env mode
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 8b01f38 commit ebaea08

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/Settings/Admin.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,14 @@ public function getForm() {
175175
}
176176

177177
$type = $this->config->getAppValue('user_saml', 'type');
178+
179+
$generalSettings['require_provisioned_account'] = [
180+
'text' => $this->l10n->t('Only allow authentication if an account exists on some other backend (e.g. LDAP).', [$this->defaults->getName()]),
181+
'type' => 'checkbox',
182+
'global' => true,
183+
'value' => $this->config->getAppValue('user_saml', 'general-require_provisioned_account', '0')
184+
];
178185
if ($type === 'saml') {
179-
$generalSettings['require_provisioned_account'] = [
180-
'text' => $this->l10n->t('Only allow authentication if an account exists on some other backend (e.g. LDAP).', [$this->defaults->getName()]),
181-
'type' => 'checkbox',
182-
'global' => true,
183-
'value' => $this->config->getAppValue('user_saml', 'general-require_provisioned_account', '0')
184-
];
185186
$generalSettings['idp0_display_name'] = [
186187
'text' => $this->l10n->t('Optional display name of the identity provider (default: "SSO & SAML log in")'),
187188
'type' => 'line',

tests/unit/Settings/AdminTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ public function testGetFormWithoutType() {
220220
2 => 'Provider 2',
221221
]);
222222
$this->config
223-
->expects($this->once())
223+
->expects($this->exactly(2)) // 'type' and 'general-require_provisioned_account'
224224
->method('getAppValue')
225-
->with('user_saml', 'type')
226-
->willReturn('');
225+
->with('user_saml', $this->anything(), $this->anything())
226+
->willReturn($this->returnArgument(2));
227227

228228
$params = $this->formDataProvider();
229229
unset($params['general']['idp0_display_name']);

0 commit comments

Comments
 (0)