diff --git a/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc b/trunk/gosa-plugins/fai/admin/fai/class_FAI.inc
index 1d2ead0c1e8c258ecfc7415f501b4f49c0ea2e69..eb78fe08a9cb2a04193952d10e369fae340ab46a 100644 (file)
/* Ldap search for fai classes specified in this release */
$attributes = array("dn","objectClass","FAIstate","cn");
- $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH | GL_SIZELIMIT);
+ $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH);
/* check the returned objects, and add/replace them in our return variable */
foreach($res_tmp as $attr){
$name = preg_replace("/".preg_quote($release, '/')."/i","",$attr['dn']);
if(isset($attr['FAIstate'][0])){
- if(preg_match("/removed$/",$attr['FAIstate'][0])){
+ if(preg_match("/removed/",$attr['FAIstate'][0])){
if(isset($res[$name])){
unset($res[$name]);
}
/* Check if this Profile uses the source class ($cn)
*/
- if(preg_match("/".preg_quote($cn, '/')."/",$attrs['FAIclass'])){
- $attrs['FAIclass'] = preg_replace("/[ ]*".preg_quote($cn, '/')."[ ]*/i"," ",$attrs['FAIclass']);
- if(empty($attrs['FAIclass'])){
- $attrs['FAIclass'] = array();
- }
- $ldap->cd($dn['dn']);
- $ldap->modify($attrs);
-
- if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
- }
+ $classlist = split(" ", $attrs['FAIclass']);
+ $new_classlist = "";
+ foreach($classlist as $class){
+ if($class != $cn){
+ $new_classlist = $new_classlist." ".$class;
+ }
+ }
+ $attrs['FAIclass'] = $new_classlist;
+ if(empty($attrs['FAIclass'])){
+ $attrs['FAIclass'] = array();
+ }
+ $ldap->cd($dn['dn']);
+ $ldap->modify($attrs);
+
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
}
}
}
/* Ldap search for fai classes specified in this release */
$ldap->cd($fai_base);
- $ldap->search("(objectClass=FAIclass)",array("dn","objectClass","FAIstate"));
+ $ldap->search("(|(objectClass=FAIclass)(objectClass=FAIdebconfInfo))",array("dn","objectClass","FAIstate"));
/* check the returned objects, and add/replace them in our return variable */
while($attr = $ldap->fetch()){