From 4e4718e6ff5940e1e4be20d878e34ec33fb51c22 Mon Sep 17 00:00:00 2001 From: pac0san <7056343+pac0san@users.noreply.github.com> Date: Wed, 11 Mar 2020 12:53:19 +0100 Subject: [PATCH 1/2] Update README.txt Update URN to the latest format defined at the [RFC] (https://tools.ietf.org/html/rfc6338) --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 386b21cc3dec7329e89b801e8ef9793ef6c5bda5 Mon Sep 17 00:00:00 2001 From: pac0san <7056343+pac0san@users.noreply.github.com> Date: Wed, 11 Mar 2020 12:59:34 +0100 Subject: [PATCH 2/2] Update custom_hook.php Update URN to the latest format defined at the [RFC] (https://tools.ietf.org/html/rfc6338) --- custom_hook.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;