Revision: 2072
Author: olavmrk
Date: Tue Jan  5 05:51:51 2010
Log: core:AttributeMap: Allow multiple target attributes.

Patch by [email protected], attached to issue 249.
http://code.google.com/p/simplesamlphp/source/detail?r=2072

Modified:
  /trunk/modules/core/lib/Auth/Process/AttributeMap.php

=======================================
--- /trunk/modules/core/lib/Auth/Process/AttributeMap.php       Fri Aug 14  
04:07:44 2009
+++ /trunk/modules/core/lib/Auth/Process/AttributeMap.php       Tue Jan  5  
05:51:51 2010
@@ -37,7 +37,7 @@
                                throw new Exception('Invalid attribute name: ' 
. var_export($origName,  
TRUE));
                        }

-                       if(!is_string($newName)) {
+                       if(!is_string($newName) && !is_array($newName)) {
                                throw new Exception('Invalid attribute name: ' 
. var_export($newName,  
TRUE));
                        }

@@ -82,8 +82,14 @@

                foreach($attributes as $name => $values) {
                        if(array_key_exists($name, $this->map)) {
-                               $attributes[$this->map[$name]] = $values;
                                unset($attributes[$name]);
+                               if(!is_array($this->map[$name])) {
+                                       $attributes[$this->map[$name]] = 
$values;
+                               } else {
+                                       foreach($this->map[$name] as $to_map) {
+                                               $attributes[$to_map] = $values;
+                                       }
+                               }
                        }
                }

--

You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en.


Reply via email to