diff --git a/attributealter/alterfunctions.php b/attributealter/alterfunctions.php new file mode 100644 index 0000000000000000000000000000000000000000..cb0e960bd1052084b765cf40e5ae2b6acee471d9 --- /dev/null +++ b/attributealter/alterfunctions.php @@ -0,0 +1,19 @@ +<?php + + +function attributealter_test(&$attributes, $spentityid = null, $idpentityid = null) { + $attributes['injected'] = array('newvalue'); +} + +function attributealter_realm(&$attributes, $spentityid = null, $idpentityid = null) { + + if (array_key_exists('eduPersonPrincipalName', $attributes)) { + $eduppn = $attributes['eduPersonPrincipalName'][0]; + $splitted = explode('@', $eduppn); + if (count($splitted) > 1) { + $attributes['realm'] = array($splitted[1]); + } + } + +} +