Code

Check for invalid input in service
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 12:31:00 +0000 (12:31 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Aug 2007 12:31:00 +0000 (12:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7032 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_dhcpService.inc

index 6faa7caa33c31389ebdb14ffd609cc6b074c054c..25c0b53ccb669c51c24a82e48021cdbf5faf711f 100644 (file)
@@ -134,6 +134,17 @@ class dhcpService extends dhcpPlugin
   function check()
   {
     $message= array();
+
+    if (!is_id($this->statements['default-lease-time'])){
+      $message[]= _('Default lease time needs to be numeric.');
+    }
+    if (!is_id($this->statements['max-lease-time'])){
+      $message[]= _('Maximum lease time needs to be numeric.');
+    }
+    if ($this->statements['default-lease-time'] > $this->statements['max-lease-time']){
+      $message[]= _('Default lease time needs to smaller than the maximum lease time.');
+    }
+
     return $message;
   }