From 19123c0294e9011e892e14d89bf2ea40b36c4858 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 8 Oct 2008 12:05:47 +0000 Subject: [PATCH] Updated gotoLpdEnable -Added checks. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12628 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_gotoLpdEnabled.inc | 18 ++++++++++++++++++ .../systems/goto/class_workstationService.inc | 10 ++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc b/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc index 7c25d92c3..8303b1d4a 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc @@ -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; diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index 3897dfe71..619691360 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -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'])){ -- 2.30.2