Code

Updated check for new Devices.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 05:07:23 +0000 (05:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 05:07:23 +0000 (05:07 +0000)
Check for gotoMode as attribute.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7609 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_divListSystem.inc
plugins/admin/systems/class_systemManagement.inc

index 32c68d3b3cd41e07e40a4c1db5b14963f67aa5ee..b78b0bfbd17e0b373bb0823905975072c1b5abe9 100644 (file)
@@ -149,7 +149,7 @@ class divListSystem extends MultiSelectWindow
         $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete system")."'>";
       }
 
-      $type = $this->parent->get_system_type($val['objectClass']);
+      $type = $this->parent->get_system_type($val);
       $cnts[$type] ++;
  
       /* Generate picture list, which is currently disabled */
index c9974d227dcae1b44877d38665252ac5e692d55b..4ca3ab71ae585b3ca0faea85314b06daa45c6916 100644 (file)
@@ -190,9 +190,9 @@ class systems extends plugin
 
       /* Find out more about the object type */
       $ldap= $this->config->get_ldap_link();
-      $ldap->cat($this->dn, array('objectClass'));
+      $ldap->cat($this->dn, array('objectClass','gotoMode'));
       $attrs= $ldap->fetch();
-      $type= $this->get_system_type($attrs['objectClass']);
+      $type= $this->get_system_type($attrs);
 
       /* Lock the current entry, so everyone will get the
          above dialog */
@@ -424,9 +424,9 @@ class systems extends plugin
 
         /* Find out more about the object type */
         $ldap= $this->config->get_ldap_link();
-        $ldap->cat($this->dn, array('objectClass'));
+        $ldap->cat($this->dn, array('objectClass','gotoMode'));
         $attrs= $ldap->fetch();
-        $type= $this->get_system_type($attrs['objectClass']);
+        $type= $this->get_system_type($attrs);
 
         $tabs = array(
             "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs"),
@@ -703,14 +703,14 @@ class systems extends plugin
           if($oc['CLASS'] != ""){
             $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
             $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $base,
-                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT));
+                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate","gotoMode"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT));
           }
         }else{
           /* User filter? */
           if($oc['CLASS'] != ""){
             $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
             $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base,
-                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SIZELIMIT));
+                  array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate", "gotoMode"), GL_NONE | GL_SIZELIMIT));
           }
         }
       } 
@@ -719,7 +719,7 @@ class systems extends plugin
     /* Search for incoming objects */ 
     $filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
     $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, "ou=incoming,".$base,
-          array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), GL_NONE | GL_SIZELIMIT));
+          array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode"), GL_NONE | GL_SIZELIMIT));
 
     /* Get all gotoTerminal's */
     foreach ($res as $value){
@@ -740,7 +740,7 @@ class systems extends plugin
           $add= "- "._("New terminal");
         }elseif (in_array_ics('gotoWorkstation', $value['objectClass'])){
           $add= "- "._("New workstation");
-        }elseif (in_array_ics('GOhard', $value['objectClass']) && !in_array_ics("gotoMode",$value['objectClass'])){
+        }elseif (in_array_ics('GOhard', $value['objectClass']) && !isset($value['gotoMode'])){
           $add= "- "._("Unknown device");
         }elseif (in_array_ics('GOhard', $value['objectClass'])){
           $add= "- "._("New Device");
@@ -835,9 +835,10 @@ class systems extends plugin
   }
 
 
-  function get_system_type($classes)
+  function get_system_type($attrs)
   {
     $enable_arp_device_handling = preg_match("/ArpNewDevice/i",search_config($this->config->data['TABS'], "ArpNewDevice", "CLASS"));
+    $classes = $attrs['objectClass'];
 
     $type= "";
     if (in_array_ics('ieee802Device', $classes)){
@@ -852,7 +853,7 @@ class systems extends plugin
       $type= "phone";
     }elseif (in_array_ics('goServer', $classes)){
       $type= "server";
-    }elseif (in_array_ics('GOhard', $classes)&& !in_array('gotoMode', $classes) && $enable_arp_device_handling){
+    }elseif (in_array_ics('GOhard', $classes) && !isset($attrs['gotoMode']) && $enable_arp_device_handling){
       $type= "ArpNewDevice";
     }elseif (in_array_ics('GOhard', $classes)){
       $type= "NewDevice";