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

Fix group attribute generation code.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@731 44740490-163a-0410-bde0-09ae8108e29a
parent 03d0bee2
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ function getRealmPart($userid) {
$decomposedID = explode("@", $userid);
if (isset($decomposedID[1])) {
return self::encodeIllegalChars($decomposedID[1]);
return encodeIllegalChars($decomposedID[1]);
}
return null;
}
......@@ -20,7 +20,11 @@ function attributealter_groups(&$attributes, $spentityid = null, $idpentityid =
/*
* Then we add the realm of the user. The part after the @ of the eduPersonPrincipalName
*/
$realmpart = getRealmPart($attributes['eduPersonPrincipalName']);
if(array_key_exists('eduPersonPrincipalName', $attributes)) {
$realmpart = getRealmPart($attributes['eduPersonPrincipalName'][0]);
} else {
$realmpart = NULL;
}
if (isset($realmpart)) {
$groups[] = 'realm-' . $realmpart;
} else {
......
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