Skip to content
Snippets Groups Projects
Commit b9d4a419 authored by Olav Morken's avatar Olav Morken
Browse files

Add support for exporting shibmd:Scope metadata with regular expressions.

Thanks to Brook Schofield for implementing this!

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3281 44740490-163a-0410-bde0-09ae8108e29a
parent b6e1cb7a
No related branches found
No related tags found
No related merge requests found
...@@ -108,6 +108,8 @@ Common options ...@@ -108,6 +108,8 @@ Common options
`scope` `scope`
: An array with scopes for this IdP. : An array with scopes for this IdP.
The scopes will be added to the generated XML metadata. The scopes will be added to the generated XML metadata.
A scope can either be a domain name or a regular expression
matching a number of domains.
`userid.attribute` `userid.attribute`
: The attribute name of an attribute which uniquely identifies : The attribute name of an attribute which uniquely identifies
......
...@@ -114,7 +114,12 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -114,7 +114,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
foreach ($metadata->getArray('scope') as $scopetext) { foreach ($metadata->getArray('scope') as $scopetext) {
$s = new SAML2_XML_shibmd_Scope(); $s = new SAML2_XML_shibmd_Scope();
$s->scope = $scopetext; $s->scope = $scopetext;
$s->regexp = FALSE; // Check whether $ ^ ( ) * | \ are in a scope -> assume regex.
if (1 === preg_match('/[\$\^\)\(\*\|\\\\]/', $scopetext)) {
$s->regexp = TRUE;
} else {
$s->regexp = FALSE;
}
$e->Extensions[] = $s; $e->Extensions[] = $s;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment