mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-04-26 06:20:08 +02:00
Fix missing config values when switching idp
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
e378f22d10
commit
da69ddd5e3
|
@ -164,11 +164,11 @@ $(function() {
|
|||
var entries = data[category];
|
||||
Object.keys(entries).forEach(function (configKey) {
|
||||
var element = $('#user-saml-settings *[data-key="' + configKey + '"]');
|
||||
if ($('#user-saml-settings #user-saml-' + configKey).length) {
|
||||
element = $('#user-saml-' + configKey);
|
||||
if ($('#user-saml-settings #user-saml-' + category + ' #user-saml-' + configKey).length) {
|
||||
element = $('#user-saml-' + category + ' #user-saml-' + configKey);
|
||||
}
|
||||
if ($('#user-saml-settings [name="' + configKey + '"]').length) {
|
||||
element = $('[name="' + configKey + '"]');
|
||||
if ($('#user-saml-settings #user-saml-' + category + ' [name="' + configKey + '"]').length) {
|
||||
element = $('#user-saml-' + category + ' [name="' + configKey + '"]');
|
||||
}
|
||||
if(element.is('input') && element.prop('type') === 'text') {
|
||||
element.val(entries[configKey])
|
||||
|
|
|
@ -56,9 +56,10 @@ class SettingsController extends Controller {
|
|||
*/
|
||||
$params = $this->admin->getForm()->getParams();
|
||||
$params['idp'] = [
|
||||
'singleLogoutService.url' => null,
|
||||
'singleSignOnService.url' => null,
|
||||
'idp-entityId' => null,
|
||||
'singleLogoutService.url' => ['required' => false],
|
||||
'singleSignOnService.url' => ['required' => false],
|
||||
'entityId' => ['required' => false],
|
||||
'x509cert' => ['required' => false],
|
||||
];
|
||||
/* Fetch all config values for the given providerId */
|
||||
$settings = [];
|
||||
|
@ -68,11 +69,11 @@ class SettingsController extends Controller {
|
|||
}
|
||||
foreach ($content as $setting => $details) {
|
||||
$prefix = $providerId === '1' ? '' : $providerId . '-';
|
||||
$key = $prefix . $category . '-' . $setting;
|
||||
/* use security as category instead of security-* */
|
||||
if (strpos($category, 'security-') === 0) {
|
||||
$category = 'security';
|
||||
}
|
||||
$key = $prefix . $category . '-' . $setting;
|
||||
$settings[$category][$setting] = $this->config->getAppValue('user_saml', $key, '');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue