Code

Just use the -n option from dh_installinit and the world is fine again.
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_FAI.inc
index 1d2ead0c1e8c258ecfc7415f501b4f49c0ea2e69..eb78fe08a9cb2a04193952d10e369fae340ab46a 100644 (file)
@@ -64,7 +64,7 @@ class FAI
 
         /* 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){
@@ -73,7 +73,7 @@ class FAI
           $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]);
               }
@@ -249,17 +249,22 @@ class FAI
 
               /* 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()));
               }
             }
           }
@@ -613,7 +618,7 @@ class FAI
 
         /* 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()){