Code

Added more checks
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 13:00:56 +0000 (13:00 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 13:00:56 +0000 (13:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7033 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_dhcpPlugin.inc
plugins/admin/systems/class_dhcpGroup.inc
plugins/admin/systems/class_dhcpHost.inc
plugins/admin/systems/class_dhcpPool.inc
plugins/admin/systems/class_dhcpService.inc
plugins/admin/systems/class_dhcpSharedNetwork.inc
plugins/admin/systems/class_dhcpSubnet.inc
plugins/admin/systems/dhcp_network.tpl

index 0aeaa6226464be11f85a620fdefcddfb7ad3b662..b9d48b25fa2b01a92e0d8b1f6a1b2034a5ffe2b3 100644 (file)
@@ -123,7 +123,6 @@ class dhcpPlugin extends plugin
   function check($cache)
   {
     $message= array();
-
     return $message;
   }
 
index 7e90215bfca6d1dd36fa9c398d36b77c45b6d8f8..47369286e9682fd73cdab0004d58d9dfe1f3e5ff 100644 (file)
@@ -101,6 +101,10 @@ class dhcpGroup extends dhcpPlugin
       }
     }
 
+    /* Check external plugins */
+    $net= $this->network->check();
+    $adv= $this->advanced->check();
+    $message= array_merge($message, $net, $adv);
 
     return $message;
   }
index 5e9e00d22db84de518bae095f48336483cd8e601..77fdfdb6ca48488059aeeec04ccfa2b6541bd538 100644 (file)
@@ -35,8 +35,6 @@ class dhcpHost extends dhcpPlugin
       $this->dhcpHWaddress= $attrs['dhcpHWAddress'][0];
     }
 
-       print_a($this);
-
     $this->advanced->setAutoOptions(array("host-name"));
     $this->advanced->setAutoStatements(array("fixed-address"));
   }
index 5137dae9ba39064fb4fa9b2be27e20789719448b..d001c0663b7faefdfcf46ba06dc7b25ec525fd1c 100644 (file)
@@ -147,6 +147,12 @@ class dhcpPool extends dhcpPlugin
       }
       $dn= preg_replace('/^[^,]+,/', '', $dn);
     }
+
+    /* Check external plugins */
+    $net= $this->network->check();
+    $adv= $this->advanced->check();
+    $message= array_merge($message, $net, $adv);
+
     return $message;
   }
 
index 25c0b53ccb669c51c24a82e48021cdbf5faf711f..477accb7ece67d002d7c3d98002e2605a764bdcc 100644 (file)
@@ -145,6 +145,11 @@ class dhcpService extends dhcpPlugin
       $message[]= _('Default lease time needs to smaller than the maximum lease time.');
     }
 
+    /* Check external plugins */
+    $net= $this->network->check();
+    $adv= $this->advanced->check();
+    $message= array_merge($message, $net, $adv);
+
     return $message;
   }
 
index 03154b3401dc870e3151a83b1972432714586f54..1a3c61e1e50edf0f77698e5e441b34053a46f0ca 100644 (file)
@@ -148,7 +148,7 @@ class dhcpSharedNetwork extends dhcpPlugin
           "min-lease-time" => _("Min. lease time")) as $key => $val){
       if (isset($this->statements[$key]) && $this->statements[$key] != "" && 
           !is_id($this->statements[$key])){
-        $message[]= sprintf(_("The value specified as '%s' is no valid integer!"), $val);
+        $message[]= sprintf(_("The value specified as '%s' is not numeric!"), $val);
       }
     }
 
@@ -163,6 +163,11 @@ class dhcpSharedNetwork extends dhcpPlugin
       }
     }
 
+    /* Check external plugins */
+    $net= $this->network->check();
+    $adv= $this->advanced->check();
+    $message= array_merge($message, $net, $adv);
+
     return $message;
   }
 
index 0f3c712b00573d93ae2e0ddf4c140d6f2024da1a..d9751ee1dfb593e215786539841ee1e6270bb3da 100644 (file)
@@ -155,16 +155,23 @@ class dhcpSubnet extends dhcpPlugin
     }
 
     /* Check ip range */
-    if(!is_ip_range($this->range_start,$this->range_stop)){
+    if ($this->use_range){
+      if(!is_ip_range($this->range_start,$this->range_stop)){
         $message[] = _("Field 'Range' contains invalid IP range.");
-    }
+      }
 
-    /* Check if range is in the network */
-    if (!is_in_network($this->cn, $this->dhcpNetMask, $this->range_start) ||
-        !is_in_network($this->cn, $this->dhcpNetMask, $this->range_stop)){
-      $message[] = _("'Range' is not inside the configured network.");
+      /* Check if range is in the network */
+      if (!is_in_network($this->cn, $this->dhcpNetMask, $this->range_start) ||
+          !is_in_network($this->cn, $this->dhcpNetMask, $this->range_stop)){
+        $message[] = _("'Range' is not inside the configured network.");
+      }
     }
 
+    /* Check external plugins */
+    $net= $this->network->check();
+    $adv= $this->advanced->check();
+    $message= array_merge($message, $net, $adv);
+
     return $message;
   }
 
index 905fb4d6a4e87ba705641e48cc566610fe5dcb63..5645a63accfbc25730922015c8f467df8fd628dc 100644 (file)
@@ -58,7 +58,7 @@
     <tr>
      <td colspan=2>
       <br>
-      {t}Server{/t}<br>
+      {t}DNS server{/t}<br>
       <select name='dnsserver'  title='{t}List of DNS servers to be propagated{/t}' style="width:350px;" size="4">
        {html_options options=$dnsservers}
       </select>