From: cajus Date: Fri, 30 Oct 2009 09:15:27 +0000 (+0000) Subject: Added colon to avoid classes with release names beeing matched. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b8b9d71df0e6e8f72140951a820551969b543261;p=gosa.git Added colon to avoid classes with release names beeing matched. Corrected identation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14713 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc index 6b5a7e279..9dd3e8256 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc @@ -126,25 +126,21 @@ class servrepository extends goService $ldap->cd ($this->config->current['BASE']); $ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass")); + $found= false; if ($ldap->count() != 0){ $obj= array(); - $found= false; while($attrs = $ldap->fetch()){ foreach($attrs['FAIclass'] as $class){ - if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){ + if(preg_match("/:".str_replace("/","\/",$release)."$/i",$class)){ $obj[$ldap->getDN()]= $attrs['cn'][0]; $found= true; } } } + } - if ($found){ - msg_dialog::display(_("Error"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), ERROR_DIALOG); - }else{ - if(isset($this->repositories[$value])){ - unset($this->repositories[$value]); - } - } + if ($found){ + msg_dialog::display(_("Error"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), ERROR_DIALOG); }else{ if(isset($this->repositories[$value])){ unset($this->repositories[$value]);