Code

Updated New Device && opsi host
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 10:27:57 +0000 (10:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 10:27:57 +0000 (10:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13316 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_SelectDeviceType.inc
gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc

index e988fcca32632a27d1f8eca17e16141e090198ec..09e41147c8c76767cd44794b4b7e5b07eeef9e7e 100644 (file)
@@ -75,8 +75,6 @@ class SelectDeviceType extends plugin
   /* Save data to object */
   function save_object()
   {
-
-    echo "Calleed";
     plugin::save_object();
     foreach($this->attributes as $attr){
       if(isset($_POST[$attr])){
index 5f150b223e3efb09ee45a46ff0311c980f5c7e9e..911507fac553dfb1fc728076c7eb2858a3ca1681 100644 (file)
@@ -30,7 +30,7 @@ class opsiGeneric extends plugin
   private $opsi;            // The opsi handle
   public  $parent = NULL;   // The parent object (in case of samba)
 
-  private $hostId       = ""; // The host Id of the currently edit opsi host  
+  public  $hostId       = ""; // The host Id of the currently edit opsi host  
   public  $mac          = ""; // The hosts mac address
   public  $note         = ""; // A note
   public  $description  = ""; // The client description
index 08a1d6aeaf68edb1867ad540a7fb3506c8ab51a6..e6423173c36b632761505afbc960f606f857ac91 100644 (file)
@@ -370,6 +370,19 @@ class systems extends plugin
                */
               $this->systab->was_activated = TRUE;
 
+              /* Assign some default values for opsi hosts 
+               */
+              if($this->systab instanceOf opsi_tabs){
+                $ldap = $this->config->get_ldap_link();
+                $ldap->cat($dn);
+                $source_attrs = $ldap->fetch();
+                foreach(array("macAddress" => "mac" ,"cn" => "hostId","description","description") as $src => $attr){
+                  if(isset($source_attrs[$src][0])){
+                    $this->systab->by_object['opsiGeneric']->$attr = $source_attrs[$src][0];
+                  }
+                }
+              }
+
               if($selected_group != "none"){
 
                 /*******