Skip to content
Snippets Groups Projects
Commit b133940d authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Small fix for issue #537 and refactor to make code more clear.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3231 44740490-163a-0410-bde0-09ae8108e29a
parent 37679cfd
No related branches found
No related tags found
No related merge requests found
...@@ -119,28 +119,16 @@ $name = $spconfig->getLocalizedString('name', NULL); ...@@ -119,28 +119,16 @@ $name = $spconfig->getLocalizedString('name', NULL);
$attributes = $spconfig->getArray('attributes', array()); $attributes = $spconfig->getArray('attributes', array());
if ($name !== NULL && !empty($attributes)) { if ($name !== NULL && !empty($attributes)) {
$attributesrequired = $spconfig->getArray('attributes.required', array());
$nameFormat = $spconfig->getString('attributes.NameFormat', NULL);
foreach ($attributes as $attribute) {
$a = new SAML2_XML_md_RequestedAttribute();
$a->Name = $attribute;
$a->NameFormat = $nameFormat;
// Is the attribute required
if (in_array($attribute, $attributesrequired))
$a->isRequired = true;
}
$metaArray20['attributes.required'] = $attributesrequired;
$metaArray20['name'] = $name; $metaArray20['name'] = $name;
$metaArray20['attributes'] = $attributes;
$metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', array());
$description = $spconfig->getArray('description', NULL);
if ($description !== NULL) { if ($description !== NULL) {
$metaArray20['description'] = $description; $metaArray20['description'] = $description;
} }
$metaArray20['attributes'] = $attributes; $nameFormat = $spconfig->getString('attributes.NameFormat', NULL);
if ($nameFormat !== NULL) { if ($nameFormat !== NULL) {
$metaArray20['attributes.NameFormat'] = $nameFormat; $metaArray20['attributes.NameFormat'] = $nameFormat;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment