]> git.tokkee.org Git - gosa.git/commitdiff

Code

Updated gotoLpdEnable
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Oct 2008 12:05:47 +0000 (12:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Oct 2008 12:05:47 +0000 (12:05 +0000)
-Added checks.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12628 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc
gosa-plugins/goto/admin/systems/goto/class_workstationService.inc

index 7c25d92c3a8e2c3fce9a0fc1d46677b9660620c5..8303b1d4a5a14d1ff6d581ccc6cdb3af9d9e5d8e 100644 (file)
@@ -141,6 +141,24 @@ class gotoLpdEnable extends plugin
        }
 
 
+  public function check()
+  {
+    $messages = plugin::check();
+    if(!$this->is_account){
+      return($messages);
+    }
+    foreach($this->data as $id => $entry){
+      if(!tests::is_id($entry['i_Port'])){
+        $messages[] = msgPool::invalid(_("Port"));
+      }
+      if(preg_match("/:/",$entry['s_Options'])){
+        $messages[] = msgPool::invalid(_("Options"));
+      }
+    }
+    return($messages);
+  }  
+
+
   public function save_object()
   {
     if(!$this->is_account) return;
index 3897dfe71e05bdf46e3cdfe2545ac5203469eecd..6196913603eced98f9665ca62e60f15af43383c1 100644 (file)
@@ -269,10 +269,16 @@ class workservice extends plugin
     if(isset($_POST['gotoLpdEnable_Close'])){
       $this->dialog = NULL;
     }
+
     if(isset($_POST['gotoLpdEnable_Ok'])){
       $this->dialog->save_object();
-      $this->gotoLpdEnable = $this->dialog->save();
-      $this->dialog = NULL;
+      $msgs = $this->dialog->check();
+      if(count($msgs)) {
+        msg_dialog::displayChecks($msgs);
+      }else{
+        $this->gotoLpdEnable = $this->dialog->save();
+        $this->dialog = NULL;
+      }
     }
 
     if(isset($_POST['gotoLpdEnable_Edit'])){