From 394d618b01813696348bd6386e59be253d18f573 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 16 Sep 2010 13:21:16 +0000 Subject: [PATCH] Added simple check to avoid missing values git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19716 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/systems/goto/Device/Device.tpl | 9 +++++++ .../systems/goto/Device/class_Device.inc | 25 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl index 3eb9696ac..d4a3e45e9 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl @@ -123,6 +123,15 @@ {/render} + + + + + {render acl=$deviceTypeACL} + + {/render} + +
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc index f027ab152..1a7eac72c 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -84,6 +84,28 @@ class Device extends plugin return($smarty->fetch(get_template_path('goto/Device/Device.tpl', TRUE))); } + + /*! \brief Validate the user input. + */ + function check() + { + $message = plugin::check(); + + // If one of the registered user attributes is set, + // the others have to be set too. + $str = $this->manager.$this->deviceUUID.$this->deviceStatus; + if(!empty($str)){ + foreach($this->dynClasses['registeredDevice'] as $attr){ + if(empty($this->$attr)){ + $message[] = "Please set all values for 'registered device' or leave all blank! {$attr}"; + break; + } + } + } + + return($message); + } + /*! \brief Detect an object's name by querying the ldap * for the object's cn. @@ -210,7 +232,8 @@ class Device extends plugin "description" => _("Description"), "manager" => _("Manager"), "deviceUUID" => _("Uuid"), - "deviceStatus" => _("Stauts"), + "deviceStatus" => _("Status"), + "deviceType" => _("Type"), "macAddress" => _("MAC address"), "ipHostNumber" => _("IP address") ) -- 2.30.2