mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-02 17:14:53 +02:00
Fix attribute mapping config fetching
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
20757e9f0e
commit
00711b8fbb
|
@ -73,7 +73,14 @@ class SettingsController extends Controller {
|
||||||
if (strpos($category, 'security-') === 0) {
|
if (strpos($category, 'security-') === 0) {
|
||||||
$category = 'security';
|
$category = 'security';
|
||||||
}
|
}
|
||||||
$key = $prefix . $category . '-' . $setting;
|
// make sure we properly fetch the attribute mapping
|
||||||
|
// as this is the only category that has the saml- prefix on config keys
|
||||||
|
if (strpos($category, 'attribute-mapping') === 0) {
|
||||||
|
$category = 'attribute-mapping';
|
||||||
|
$key = $prefix . 'saml-attribute-mapping' . '-' . $setting;
|
||||||
|
} else {
|
||||||
|
$key = $prefix . $category . '-' . $setting;
|
||||||
|
}
|
||||||
$settings[$category][$setting] = $this->config->getAppValue('user_saml', $key, '');
|
$settings[$category][$setting] = $this->config->getAppValue('user_saml', $key, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@ class Admin implements ISettings {
|
||||||
'security-required' => $securityRequiredFields,
|
'security-required' => $securityRequiredFields,
|
||||||
'security-general' => $securityGeneral,
|
'security-general' => $securityGeneral,
|
||||||
'general' => $generalSettings,
|
'general' => $generalSettings,
|
||||||
'attributeMappings' => $attributeMappingSettings,
|
'attribute-mapping' => $attributeMappingSettings,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'providers' => $providers
|
'providers' => $providers
|
||||||
];
|
];
|
||||||
|
|
|
@ -120,7 +120,7 @@ style('user_saml', 'admin');
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="hidden">
|
<div class="hidden">
|
||||||
<?php foreach($_['attributeMappings'] as $key => $attribute): ?>
|
<?php foreach($_['attribute-mapping'] as $key => $attribute): ?>
|
||||||
<?php
|
<?php
|
||||||
if($attribute['type'] === 'line'): ?>
|
if($attribute['type'] === 'line'): ?>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -137,7 +137,7 @@ class AdminTest extends \Test\TestCase {
|
||||||
'security-required' => $securityRequiredFields,
|
'security-required' => $securityRequiredFields,
|
||||||
'security-general' => $securityGeneral,
|
'security-general' => $securityGeneral,
|
||||||
'general' => $generalSettings,
|
'general' => $generalSettings,
|
||||||
'attributeMappings' => $attributeMappingSettings,
|
'attribute-mapping' => $attributeMappingSettings,
|
||||||
'providers' => [
|
'providers' => [
|
||||||
['id' => 1, 'name' => 'Provider 1'],
|
['id' => 1, 'name' => 'Provider 1'],
|
||||||
['id' => 2, 'name' => 'Provider 2']
|
['id' => 2, 'name' => 'Provider 2']
|
||||||
|
|
Loading…
Reference in a new issue