From e049c33f887d31c444fe771e97e532bc0eb90670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Wed, 13 Feb 2008 07:18:59 +0000 Subject: [PATCH] Added example functions for attribute alter git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@286 44740490-163a-0410-bde0-09ae8108e29a --- attributealter/alterfunctions.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 attributealter/alterfunctions.php diff --git a/attributealter/alterfunctions.php b/attributealter/alterfunctions.php new file mode 100644 index 000000000..cb0e960bd --- /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]); + } + } + +} + -- GitLab