Code

Apply patch for #3558
[gosa.git] / trunk / gosa-plugins / systems / admin / systems / class_systemManagement.inc
index 722af8e4c6e196be3de32a2c4ca77929452a257e..d240cece85caabbe2648ec94ab30929b96a5d0be 100644 (file)
@@ -409,14 +409,13 @@ class systems extends plugin
                 }
 
                 /*******
-                 * Set default system specific attributes 
+                 * Enable inheritance
                  */
-                foreach (array("workservice", "termservice") as $cls){
+                foreach (array("workgeneric", "termgeneric") as $cls){
                   if (isset($this->systab->by_object[$cls])){
-                    $this->systab->by_object[$cls]->gotoXMouseport= "";
-                    $this->systab->by_object[$cls]->gotoXMouseType= "";
-                    $this->systab->by_object[$cls]->gotoXResolution= "";
-                    $this->systab->by_object[$cls]->gotoXColordepth= "";
+                    $this->systab->by_object[$cls]->member_of_ogroup = true;
+                    $this->systab->by_object[$cls]->set_everything_to_inherited();
+                    $this->systab->by_object[$cls]->save();
                   }
                 }
 
@@ -426,11 +425,6 @@ class systems extends plugin
                     $this->systab->by_object[$cls]->auto_activate= TRUE;
                   }
                 }
-
-                // Enable sending of LDAP events
-                if (isset($this->systab->by_object["workstartup"])){
-                  $this->systab->by_object["workstartup"]->gotoLdap_inherit= TRUE;
-                }
               }
 
               /* Don't save directly if there is no objectGroup selected.
@@ -924,6 +918,7 @@ class systems extends plugin
             if(in_array($type,array("ArpNewDevice","NewDevice")) && class_available("termgeneric")){
               $this->systab= new termgeneric($this->config, $dn);
               $this->systab->set_acl_base($dn);
+              $this->systab->set_acl_category("terminal");
               $this->systab->remove_from_parent();
             }elseif($tabtype=="phonetabs"){
               $this->systab= new $tabtype($this->config, $this->config->data['TABS'][$tabobj], $dn,$type);
@@ -1257,7 +1252,14 @@ class systems extends plugin
         }else{
           /* User filter? */
           if($oc['CLASS'] != ""){
-            $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
+            $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")";
+            /* Decide weither to search in description and CN or only in the CN */
+            if ($this->DivListSystem->DescSearch) {
+              $filter = $filter . "(|(cn=".$this->DivListSystem->Regex.")(description=".$this->DivListSystem->Regex.")))";
+            }
+            else {
+              $filter = $filter . "(cn=".$this->DivListSystem->Regex."))";
+            }
             $res = array_merge($res,get_list($filter,$sys_categories,$oc['TREE'].$base, $sys_attrs,  GL_SIZELIMIT));
           }
         }
@@ -1265,7 +1267,13 @@ class systems extends plugin
     }
 
     /* Search for incoming objects */ 
-    $filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
+    $filter = "(|(&".$userregex."(objectClass=goHard)";
+    if ($this->DivListSystem->DescSearch) {
+      $filter = $filter . "(|(cn=".$this->DivListSystem->Regex.")(description=".$this->DivListSystem->Regex.")))";
+    }
+    else {
+      $filter = $filter . "(cn=".$this->DivListSystem->Regex.")))";
+    }
     $res = array_merge($res,get_list($filter,$sys_categories, get_ou('systemIncomingRDN').$base,$sys_attrs, GL_SIZELIMIT));
 
     /* Append opsi systems, the opsi extension have to installed.