Code

Updated POST handling for dhcpHost.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Aug 2007 09:14:21 +0000 (09:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Aug 2007 09:14:21 +0000 (09:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7045 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_dhcpHost.inc
plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/dhcp_host.tpl

index 479707c00f0c62de65b7133cd829900893e45979..c6ce4dacf93e512be0409d9489ce75c44c781f07 100644 (file)
@@ -96,7 +96,7 @@ class dhcpHost extends dhcpPlugin
   function save_object()
   {
     /* Save remaining attributes */
-    if (isset($_POST['hwtype'])){
+    if (isset($_POST['dhcp_host_posted'])){
 
       /* Assemble hwAddress */
       if (isset($_POST['dhcpHWAddress'])){
@@ -108,10 +108,12 @@ class dhcpHost extends dhcpPlugin
       }
 
       /* Save fixed address */
-      if (!$this->realGosaHost && $_POST['fixedaddr'] != ""){
-        $this->statements['fixed-address']= get_post('fixedaddr');
-      } else {
-        unset ($this->statements['fixed-address']);
+      if(!$this->realGosaHost){
+        if ($_POST['fixedaddr'] != ""){
+          $this->statements['fixed-address']= get_post('fixedaddr');
+        } else {
+          unset ($this->statements['fixed-address']);
+        }
       }
       $this->options['host-name']= $this->cn;
     }
@@ -170,5 +172,5 @@ class dhcpHost extends dhcpPlugin
   }
 
 }
-
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 6c82146b1a1821c023bb2b30eadc46176de77444..8f0c21fc7668ed493c5d75f7e382f70547d665c9 100644 (file)
@@ -553,6 +553,8 @@ class termDNS extends plugin
         unset($attrs['dn']);
         $ldap->cd("cn=".$this->cn.",".$this->dhcpParentNode);
         $res = $ldap->add($attrs);
+#        print_a($attrs);
+#        print("cn=".$this->cn.",".$this->dhcpParentNode);
         show_ldap_error($ldap->get_error(),_("Tried to add new dhcp entry failed."));
       }
 
index c5ee7a2810692ace1cc6e8e25e5782656deb680d..602c51255288c0ec5b797e58288e62db6249e742 100644 (file)
@@ -41,7 +41,7 @@
   </td>
  </tr>
 </table>
-
+<input type='hidden' name='dhcp_host_posted' value='1'>
 <p class="seperator"></p>
 
 <!-- Place cursor in correct field -->