From bfe0c95c269d33d20d4fd22c982b3ad7d72c2f7a Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 17 Dec 2007 07:26:12 +0000 Subject: [PATCH] Multiple posix edit. -Added missing checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8131 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/posix/class_posixAccount.inc | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 4f4380a89..554e7e6f7 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -1043,6 +1043,60 @@ class posixAccount extends plugin return ($message); } + + function multiple_check() + { + $message = plugin::multiple_check(); + if ($this->homeDirectory == "" && in_array("homeDirectory",$this->multi_boxes)){ + $message[]= _("The required field 'Home directory' is not set."); + } + if (!is_path($this->homeDirectory) && in_array("homeDirectory",$this->multi_boxes)){ + $message[]= _("Please enter a valid path in 'Home directory' field."); + } + + /* Check shadow settings, well I like spaghetties... */ + if ($this->activate_shadowMin && in_array("activate_shadowMin",$this->multi_boxes)){ + if (!is_id($this->shadowMin)){ + $message[]= _("Value specified as 'shadowMin' is not valid."); + } + } + if ($this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){ + if (!is_id($this->shadowMax)){ + $message[]= _("Value specified as 'shadowMax' is not valid."); + } + } + if ($this->activate_shadowWarning && in_array("activate_shadowWarning",$this->multi_boxes)){ + if (!is_id($this->shadowWarning)){ + $message[]= _("Value specified as 'shadowWarning' is not valid."); + } + if (!$this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){ + $message[]= _("'shadowWarning' without 'shadowMax' makes no sense."); + } + if ($this->shadowWarning > $this->shadowMax && in_array("activate_shadowWarning",$this->multi_boxes)){ + $message[]= _("Value specified as 'shadowWarning' should be smaller than 'shadowMax'."); + } + if ($this->activate_shadowMin && $this->shadowWarning < $this->shadowMin && in_array("activate_shadowMin",$this->multi_boxes)){ + $message[]= _("Value specified as 'shadowWarning' should be greater than 'shadowMin'."); + } + } + if ($this->activate_shadowInactive && in_array("activate_shadowInactive",$this->multi_boxes)){ + if (!is_id($this->shadowInactive)){ + $message[]= _("Value specified as 'shadowInactive' is not valid."); + } + if (!$this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){ + $message[]= _("'shadowInactive' without 'shadowMax' makes no sense."); + } + } + if ($this->activate_shadowMin && $this->activate_shadowMax && in_array("activate_shadowMin",$this->multi_boxes)){ + if ($this->shadowMin > $this->shadowMax){ + $message[]= _("Value specified as 'shadowMin' should be smaller than 'shadowMax'."); + } + } + + return($message); + } + + function addGroup ($groups) { /* include global link_info */ -- 2.30.2