fixed alias handling (bug 2901248)
This commit is contained in:
		
							parent
							
								
									cdc3d67a76
								
							
						
					
					
						commit
						7aed5a729e
					
				|  | @ -5,6 +5,7 @@ December 2009 2.9.0 | ||||||
| 	 -> Unable to edit accounts with DNs that contain spaces next to a comma (2889473) | 	 -> 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) | 	 -> Login method "LDAP search" has problems if LDAP server is down (2889414) | ||||||
| 	 -> filter in account lists did not support non-ASCII letters | 	 -> filter in account lists did not support non-ASCII letters | ||||||
|  | 	 -> alias handling (2901248) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 28.10.2009 2.8.0 | 28.10.2009 2.8.0 | ||||||
|  |  | ||||||
|  | @ -1701,6 +1701,7 @@ function get_schema_attributes($dn = null, $use_cache=true ) | ||||||
|  */ |  */ | ||||||
| function add_aliases_to_attrs( &$attrs ) | function add_aliases_to_attrs( &$attrs ) | ||||||
| { | { | ||||||
|  | 	$toaddAttrs = array(); | ||||||
| 	// go back and add data from aliased attributeTypes
 | 	// go back and add data from aliased attributeTypes
 | ||||||
| 	foreach( $attrs as $name => $attr ) { | 	foreach( $attrs as $name => $attr ) { | ||||||
| 		$aliases = $attr->getAliases(); | 		$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
 | 			// 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
 | 			// with its name set to the alias name, and all other data copied
 | ||||||
| 			foreach( $aliases as $alias_attr_name ) { | 			foreach( $aliases as $alias_attr_name ) { | ||||||
| 				$new_attr = $attr; | 				$new_attr = clone $attr; | ||||||
| 				$new_attr->setName( $alias_attr_name ); | 				$new_attr->setName( $alias_attr_name ); | ||||||
| 				$new_attr->addAlias( $attr->getName() ); | 				$new_attr->addAlias( $attr->getName() ); | ||||||
| 				$new_attr->removeAlias( $alias_attr_name ); | 				$new_attr->removeAlias( $alias_attr_name ); | ||||||
| 				$new_attr_key = strtolower( $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); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue