diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc
index 757f0b9338d98c7db5cf7d0cd0325c694e0c40c5..8bb55fb52dc1c3d36bf1e0b68979e55ffd355444 100644 (file)
/* Eventually colorize phones */
$ldap->cd($this->config->current['BASE']);
- foreach ($this->hardware_list as $cn => $desc){
- $ldap->search("(goFonHardware=$cn)", array('cn'));
- if ($ldap->count() > 0){
- $ldap->fetch();
- if ($ldap->getDN() != $this->dn){
- $this->used_hardware[$cn]= $ldap->getDN();
+ $ldap->search("(goFonHardware=*)",array('cn','dn','goFonHardware'));
+ while($attrs = $ldap->fetch()){
+ $cn = $attrs['goFonHardware'][0];
+ if(isset($this->hardware_list[$cn])){
+ $this->used_hardware[$cn]= $cn;
}
- }
}
if(preg_match("/\+/",$this->gotoXHsync)){