Code

Fixed termDNS function definition.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Sep 2007 06:17:49 +0000 (06:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Sep 2007 06:17:49 +0000 (06:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7364 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_componentGeneric.inc
plugins/admin/systems/class_phoneGeneric.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_servGeneric.inc
plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/class_winGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc

index 32530a5b594045215ac65a07474a5c0063e0f151..5605253aa5b91b0dbcf2072c7aba3632332a303d 100644 (file)
@@ -35,7 +35,7 @@ class componentGeneric extends plugin
     } else {
       $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
     }
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
   }
@@ -259,7 +259,7 @@ class componentGeneric extends plugin
     }
 
     $this->netConfigDNS->cn = $this->cn;
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system component/generic with dn '%s' failed."),$this->dn));
   }
index bb4efc3578bdd0b79e0d2673f7c7c26baa1bd951..1d8ff6c4568c746a0e729602038b67fe253016ae 100644 (file)
@@ -57,7 +57,7 @@ class phoneGeneric extends plugin
   function phonegeneric (&$config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
 
     /* Set base */
     if ($this->dn == "new"){
@@ -430,7 +430,7 @@ class phoneGeneric extends plugin
       $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
     }
     $this->netConfigDNS->cn = $this->cn;    
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system phone/generic with dn '%s' failed."),$this->dn));
   }
 
index ccadc0dd43bf57adf8ef3bdd2e5658929f9b1ed7..5b77578fed86ed386f1063659732fcb9fbe1a0f3 100644 (file)
@@ -91,7 +91,7 @@ class printgeneric extends plugin
     }
     
     /* create dns object */
-    $this->netConfigDNS = new termDNS($this->config, $this->dn,$this->objectclasses);
+    $this->netConfigDNS = new termDNS($this->config, $this,$this->objectclasses);
 
     /* Set base */
     if ($this->dn == "new"){
@@ -847,7 +847,7 @@ class printgeneric extends plugin
     if(preg_match("/printer/i",$this->BelongsTo)){
       $this->netConfigDNS->cn = $this->cn;
       $this->netConfigDNS->dn = $this->dn;
-      $this->netConfigDNS->save($this->dn);
+      $this->netConfigDNS->save();
     }
 
     /* This is a multi object. Handle tagging here... */
index 1acaaad4cb50a9a12ad2407207ccd6b6faf6a04a..d74fb92cd08a1625a2fb7385a68359937d2b5945 100644 (file)
@@ -62,7 +62,7 @@ class servgeneric extends plugin
     } else {
       $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
     }
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     $this->netConfigDNS->set_acl_category("server");
     $this->netConfigDNS->set_acl_base($this->base);
        
@@ -360,7 +360,7 @@ class servgeneric extends plugin
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic with dn '%s' failed."),$this->dn)); 
     $this->netConfigDNS->cn = $this->cn;
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
 
     /* Optionally execute a command after we're done */
     if(!$this->didAction){
index 9b91a0b89292f6ede0a030702d33bdee3877b439..79c26bfdb39eef0202f9e208d7523a61871471bf 100644 (file)
@@ -42,15 +42,16 @@ class termDNS extends plugin
 
   /*  Terminal dns 
    */
-  function termDNS (&$config, $dn,$objectClasses,$IPisMust = false)
+  function termDNS (&$config, $parent,$objectClasses,$IPisMust = false)
   {
     /* We need to know which objectClasses are used, to store the ip/mac
      * Because of different type of devices   
-     */
+     */ 
+    $this->parent         = $parent;
     $this->objectclasses  =  $objectClasses;
     $this->IPisMust       = $IPisMust;
 
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, $parent->dn);
 
     if(isset($this->attrs['cn'][0])){
       $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
@@ -521,10 +522,12 @@ class termDNS extends plugin
 
 
   /* Save to LDAP */
-  function save($dn)
+  function save()
   {
     $ldap= $this->config->get_ldap_link();
-   
+  
+    $dn = $this->parent->dn;
     /*******************/ 
     /* IP-MAC HANDLING */
     /*******************/ 
index 57a70ff55455afe9ae42416ea2e6d10928af1148..6b7d04b4fb9797191eb49971c061fbc62ba7bc7b 100644 (file)
@@ -77,7 +77,7 @@ class termgeneric extends plugin
       $this->member_of_ogroup = $ldap->count() >= 1;
     }
 
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     /* Read arrays */
     foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
       if (!isset($this->attrs[$val])){
@@ -560,7 +560,7 @@ class termgeneric extends plugin
     }
 
     $this->netConfigDNS->cn = $this->cn;
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/generic with dn '%s' failed."),$this->dn));
   }
 
index b1778a1a8cddbd792dfd1330d509d818dadf2e4a..173d6552089ad8516af42172b9837924f44066da 100644 (file)
@@ -49,7 +49,7 @@ class wingeneric extends plugin
   function wingeneric (&$config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
     /* Set base */
     if ($this->dn == "new"){
       $ui= get_userinfo();
@@ -269,7 +269,7 @@ class wingeneric extends plugin
     }
 
     $this->netConfigDNS->cn =  preg_replace("/\\\$\$/","",$this->cn);
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system wingeneric/generic with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 59427c35a9801c0bec207a38d351b99c2d8babb1..734a8459842e8ccf797df2f0fc2c9aca0a08cf56 100644 (file)
@@ -82,7 +82,7 @@ class workgeneric extends plugin
       $this->member_of_ogroup = $ldap->count() >= 1;
     }
 
-    $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+    $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
 
     /* Read arrays */
     foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
@@ -547,7 +547,7 @@ class workgeneric extends plugin
     }
 
     $this->netConfigDNS->cn = $this->cn;
-    $this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->save();
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn));
   }