fixed alias handling (bug 2901248)

This commit is contained in:
Roland Gruber 2009-11-21 13:53:17 +00:00
parent cdc3d67a76
commit 7aed5a729e
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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);
}
/**