diff --git a/README.txt b/README.txt index 10df4f1..c9e5465 100644 --- a/README.txt +++ b/README.txt @@ -32,5 +32,5 @@ Important for enrollment!! ========================== This plugin suppose that the IdP send the courses data of the user in a attribute that can be configured but the pattern of the expected data is defined per the [RFC](https://tools.ietf.org/html/rfc6338) -urn:mace:terena.org:schac:userStatus:::::: +urn:schac:userStatus:::::: You can change this pattern editing the saml_hook_get_course_info method from the custom_hook.php file. diff --git a/custom_hook.php b/custom_hook.php index bbae5de..63959c4 100644 --- a/custom_hook.php +++ b/custom_hook.php @@ -69,7 +69,7 @@ function saml_hook_attribute_filter(&$saml_attributes) { if(isset($saml_attributes['schacPersonalUniqueID'])) { foreach($saml_attributes['schacPersonalUniqueID'] as $key => $value) { $data = []; - if(preg_match('/urn:mace:terena.org:schac:personalUniqueID:es:(.*):(.*)/', $value, $data)) { + if(preg_match('/urn:schac:personalUniqueID:es:(.*):(.*)/', $value, $data)) { $saml_attributes['schacPersonalUniqueID'][$key] = $data[2]; //DNI sin letra //$saml_attributes['schacPersonalUniqueID'][$key] = substr($value[2], 0, 8); @@ -187,7 +187,7 @@ function saml_hook_post_user_created($user, $saml_attributes = []) { function saml_hook_get_course_info($course) { $regs = null; - $regex = '/urn:mace:terena.org:schac:userStatus:(.+):(.+):(.+):(.+):(.+):(.+)/'; + $regex = '/urn:schac:userStatus:(.+):(.+):(.+):(.+):(.+):(.+)/'; if (preg_match($regex, $course, $matches)) { $regs = $matches;