diff --git a/lam/HISTORY b/lam/HISTORY index 907cfce5..0ac21d06 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -5,6 +5,7 @@ December 2009 2.9.0 -> Unable to edit accounts with DNs that contain spaces next to a comma (2889473) -> Login method "LDAP search" has problems if LDAP server is down (2889414) -> filter in account lists did not support non-ASCII letters + -> alias handling (2901248) 28.10.2009 2.8.0 diff --git a/lam/lib/schema.inc b/lam/lib/schema.inc index 05ccfc9f..37419ccf 100644 --- a/lam/lib/schema.inc +++ b/lam/lib/schema.inc @@ -1701,6 +1701,7 @@ function get_schema_attributes($dn = null, $use_cache=true ) */ function add_aliases_to_attrs( &$attrs ) { + $toaddAttrs = array(); // go back and add data from aliased attributeTypes foreach( $attrs as $name => $attr ) { $aliases = $attr->getAliases(); @@ -1708,15 +1709,16 @@ function add_aliases_to_attrs( &$attrs ) // foreach of the attribute's aliases, create a new entry in the attrs array // with its name set to the alias name, and all other data copied foreach( $aliases as $alias_attr_name ) { - $new_attr = $attr; + $new_attr = clone $attr; $new_attr->setName( $alias_attr_name ); $new_attr->addAlias( $attr->getName() ); $new_attr->removeAlias( $alias_attr_name ); $new_attr_key = strtolower( $alias_attr_name ); - $attrs[ $new_attr_key ] = $new_attr; + $toaddAttrs[ $new_attr_key ] = $new_attr; } } } + $attrs = array_merge($attrs, $toaddAttrs); } /**