Code

Added magic_quotes fix for Profile
[gosa.git] / plugins / admin / systems / class_systemManagement.inc
index 03aca02f7de422421937333c3b2a97b7fd2b7d9d..12aba77da5f92cc65ec0ad1e031f01049c15a3f0 100644 (file)
@@ -90,7 +90,6 @@ class systems extends plugin
       $terminalfilter['regex']= $s;
     }
 
-    $terminalfilter   = get_global("terminalfilter"); // contains Filter Settings
     $s_action     = "";                       // Contains the action to proceed
     $s_entry      = "";                       // The value for s_action
     $base_back    = "";                       // The Link for Backbutton
@@ -555,14 +554,12 @@ class systems extends plugin
     " <input type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
     " <input type='image' align='middle' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."'                     name='dep_home'>&nbsp;".
     " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-    " <input type='image' align='middle' src='images/select_terminal.png'   name='newsystem_terminal'    alt='"._("New Terminal")."' title='"._("New Terminal")."'>".
-    " <input type='image' align='middle' src='images/select_winstation.png' name='newsystem_workstation' alt='"._("New Workstation")."' title='"._("New Workstation")."'>".
-    " <input type='image' align='middle' src='images/select_server.png'     name='newsystem_server'      alt='"._("New Server")."' title='"._("New Server")."'>".
-    " <input type='image' align='middle' src='images/select_printer.png'    name='newsystem_printer'     alt='"._("New Printer")."' title='"._("New Printer")."'>".
-    " <input type='image' align='middle' src='images/select_phone.png'      name='newsystem_phone'       alt='"._("New Phone")."' title='"._("New Phone")."'>".
-    " <input type='image' align='middle' src='images/select_component.png'  name='newsystem_component'   alt='"._("New Component")."' title='"._("New Component")."'>".
-    " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-    " <input type='image' align='middle' src='images/list_new_user.png' title='"._("Create new system")."' alt='"._("New system")."'                    name='user_new'>&nbsp;".
+    " <input type='image' align='middle' src='images/select_new_terminal.png'   name='newsystem_terminal'    alt='"._("New Terminal")."' title='"._("New Terminal")."'>".
+    " <input type='image' align='middle' src='images/select_new_workstation.png' name='newsystem_workstation' alt='"._("New Workstation")."' title='"._("New Workstation")."'>".
+    " <input type='image' align='middle' src='images/select_new_server.png'     name='newsystem_server'      alt='"._("New Server")."' title='"._("New Server")."'>".
+    " <input type='image' align='middle' src='images/select_new_printer.png'    name='newsystem_printer'     alt='"._("New Printer")."' title='"._("New Printer")."'>".
+    " <input type='image' align='middle' src='images/select_new_phone.png'      name='newsystem_phone'       alt='"._("New Phone")."' title='"._("New Phone")."'>".
+    " <input type='image' align='middle' src='images/select_new_component.png'  name='newsystem_component'   alt='"._("New Component")."' title='"._("New Component")."'>".
     " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
     _("Current base")."&nbsp;<select name='depselect' onChange='mainform.submit()'>$options</select>".
     " <input type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;".
@@ -571,7 +568,7 @@ class systems extends plugin
 
 
     $action= "<input type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit system")."'>";
-    $action.= "<input type='image' src='images/editdelete.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
+    $action.= "<input type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
 
 
     $divlist = new divlist("systemstab");
@@ -633,7 +630,7 @@ class systems extends plugin
       if(in_array("goSyslogServer"  ,$val['objectClass'])) $syslog  = $img3;   else $syslog=$empty;
       if(in_array("goImapServer"    ,$val['objectClass'])) $imap    = $img4;   else $imap  =$empty;
       if(in_array("sambaSamAccount" ,$val['objectClass'])) $samba   = $img5;   else $samba =$empty;
-      if(in_array("goNfsServer"     ,$val['objectClass'])) $nfs     = $img6;   else $nfs   =$empty;
+      if(in_array("goShareServer"   ,$val['objectClass'])) $nfs     = $img6;   else $nfs   =$empty;
       if(in_array("goKrbServer"     ,$val['objectClass'])) $krb     = $img7;   else $krb   =$empty;
       if(in_array("goFonServer"     ,$val['objectClass'])) $fon     = $img8;   else $fon   =$empty;
       if(in_array("goFaxServer"     ,$val['objectClass'])) $fax     = $img9;   else $fax   =$empty;
@@ -648,13 +645,12 @@ class systems extends plugin
         $display= "".$val["cn"][0]."";
       }
 
-      if(in_array("gotoTerminal",$val['objectClass'])){
+      if((in_array("gotoTerminal",$val['objectClass']))||(in_array("gotoWorkstation",$val['objectClass']))){
         $action2 = "<input type='image' src='images/certs.png' alt='"._("Password")."'   name='user_setpwd_%KEY%' title='"._("Set root password")."'>";
       }else{
         $action2 = "";
       }
 
-
       if(isset($val['message'])){
         $display.= "  (".$val['message']." '".$this->config->idepartments[$terminalfilter['depselect']]."'  )";
       }
@@ -667,14 +663,11 @@ class systems extends plugin
       $divlist->AddEntry( array($field1,$field2,$field3));
     }
 
-
-
-
-
     /* Show main page */
     $smarty->assign("terminalshead", $listhead);
     $smarty->assign("terminals", $divlist->DrawList());
     $smarty->assign("search_image", get_template_path('images/search.png'));
+    $smarty->assign("searchu_image", get_template_path('images/search_user.png'));
     $smarty->assign("tree_image", get_template_path('images/tree.png'));
     $smarty->assign("infoimage", get_template_path('images/info.png'));
     $smarty->assign("launchimage", get_template_path('images/launch.png'));
@@ -832,10 +825,41 @@ class systems extends plugin
     /* Get all gotoTerminal's */
     $this->terminals= array();
 
-    $res= get_list($this->ui->subtreeACL, "(|$termfilter$workfilter$winfilter$printfilter$phonefilter$serverfilter$netfilter)", TRUE, $base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), TRUE);
+    $res= get_list($this->ui->subtreeACL, "(|$termfilter)", FALSE, "ou=terminals,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE);
+
+    $res= array_merge($res,get_list($this->ui->subtreeACL, "(|$termfilter)", FALSE, "ou=incoming,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$serverfilter)", FALSE, "ou=servers,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
 
-      
-    /* NEW LIST MANAGMENT
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$phonefilter)", FALSE, "ou=phones,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$netfilter)", FALSE, "ou=netdevices,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$printfilter)", FALSE, "ou=printers,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$workfilter)", FALSE, "ou=workstations,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$workfilter)", FALSE, "ou=incoming,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+    $res= array_merge($res,
+          get_list($this->ui->subtreeACL, "(|$winfilter)", FALSE, "ou=winstations,ou=systems,".$base, 
+        array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), FALSE));
+
+/* NEW LIST MANAGMENT
      * We also need to search for the departments
      * So we are able to navigate like in konquerer
      */
@@ -892,10 +916,10 @@ class systems extends plugin
       }
       if (preg_match ("/,ou=incoming,/i", $tmp)){
         if (in_array('gotoTerminal', $value['objectClass'])){
-          $add= "+ "._("New terminal");
+          $add= "- "._("New terminal");
         }
         if (in_array('gotoWorkstation', $value['objectClass'])){
-          $add= "+ "._("New workstation");
+          $add= "- "._("New workstation");
         }
       } else {
         $add= "";
@@ -919,6 +943,7 @@ class systems extends plugin
           if (isset($value["macAddress"][0]) &&  $value["macAddress"][0] != "-"){
             $terminal             = $value;
             $terminal['type']     = "L";
+            $terminal['is_new']   = $add;
           } else {
             $terminal             = $value;
             $terminal['type']     = "D";
@@ -954,7 +979,7 @@ class systems extends plugin
 
     $tmp=array();
     foreach($this->terminals as $tkey => $val ){
-      $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+      $tmp[strtolower($val['cn'][0]).$val['dn']]=$val;
     }
     ksort($tmp);
     $this->terminals=array();