Code

Fixed wrong existance check
[gosa.git] / gosa-plugins / systems / admin / systems / class_systemManagement.inc
index df39a9c3c796e5804407eef009dae0a7080d1d27..844e9f629ef24a9ed2fa44844db9291c63700453 100644 (file)
@@ -1300,9 +1300,12 @@ class systems extends plugin
     $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.
-        (Only, if we are allowed to view opsi hosts)
+        (Only, if we are allowed to view opsi hosts and if we're on the ldap root)
      */
-    if($this->opsi instanceof opsi && $this->opsi->enabled() && $this->DivListSystem->ShowOpsiHosts){
+    if($this->DivListSystem->selectedBase == $this->config->current['BASE'] && 
+        $this->opsi instanceof opsi && 
+        $this->opsi->enabled() && 
+        $this->DivListSystem->ShowOpsiHosts){
       $o_acl = $this->ui->get_permissions($base,"opsi/opsiGeneric","");
       if(preg_match("/r/",$o_acl)){
         $opsi_clients = $this->opsi->get_hosts_for_system_management();
@@ -1467,8 +1470,9 @@ class systems extends plugin
        If there is a samba host, then merge it with the opsi host,
         to avoid duplicate entries.
      */
+    $oRex = preg_replace("/\*/",".*",$this->DivListSystem->Regex);
     foreach($opsi_clients as $entry){
-      if(isset($opsi_map[$entry['cn'][0]]) || !preg_match("/".$this->DivListSystem->Regex."/", $entry['cn'][0])){
+      if(isset($opsi_map[$entry['cn'][0]]) || !preg_match("/".($oRex)."/", $entry['cn'][0])){
         continue;
       }
       $terminal             = $entry;