summaryrefslogtreecommitdiffstats
path: root/attributealter/alterfunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'attributealter/alterfunctions.php')
-rw-r--r--attributealter/alterfunctions.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/attributealter/alterfunctions.php b/attributealter/alterfunctions.php
index cb0e960..7d247bf 100644
--- a/attributealter/alterfunctions.php
+++ b/attributealter/alterfunctions.php
@@ -7,12 +7,18 @@ function attributealter_test(&$attributes, $spentityid = null, $idpentityid = nu
function attributealter_realm(&$attributes, $spentityid = null, $idpentityid = null) {
- if (array_key_exists('eduPersonPrincipalName', $attributes)) {
- $eduppn = $attributes['eduPersonPrincipalName'][0];
+ $attributename = 'eduPersonPrincipalName';
+# $attributename = 'edupersonprincipalname';
+ if (array_key_exists($attributename, $attributes)) {
+ $eduppn = $attributes[$attributename][0];
$splitted = explode('@', $eduppn);
if (count($splitted) > 1) {
$attributes['realm'] = array($splitted[1]);
+ } else {
+ SimpleSAML_Logger::debug('attributealter_realm: Wrong format on ' . $attributename . ' (not including @)');
}
+ } else {
+ SimpleSAML_Logger::debug('attributealter_realm: Could not find ' . $attributename);
}
}