From 3536e72afaac8a39178a3927e34c5c47bf979a69 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 4 Apr 2007 10:14:38 +0000 Subject: [PATCH] Added some checks to attributes collected by setup. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5975 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setupStep5.inc | 9 +++++++++ setup/class_setupStep6.inc | 5 +++++ setup/class_setupStep6a.inc | 22 +++++++++++++++++++++- setup/setup_step6a.tpl | 23 ++++++++++++++--------- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/setup/class_setupStep5.inc b/setup/class_setupStep5.inc index 01d6ed167..8b6acec6f 100644 --- a/setup/class_setupStep5.inc +++ b/setup/class_setupStep5.inc @@ -130,6 +130,15 @@ class setup_step_5 extends setup_step function check() { $message = array(); + + if(preg_match("/,$/",$this->peopleou)){ + $message[] =sprintf(_("Don't add a trailing comma to '%s'."),_("People storage ou")); + } + + if(preg_match("/,$/",$this->groupou)){ + $message[] =sprintf(_("Don't add a trailing comma to '%s'."),_("Group storage ou")); + } + if(!is_numeric($this->uidbase)){ $message[] = _("Uid base must be numeric"); } diff --git a/setup/class_setupStep6.inc b/setup/class_setupStep6.inc index c9c61ec31..30dd7f931 100644 --- a/setup/class_setupStep6.inc +++ b/setup/class_setupStep6.inc @@ -177,6 +177,11 @@ class setup_step_6 extends setup_step function check() { $message = array(); + + if(isset($this->generic_settings['minid_active']) && !is_numeric($this->generic_settings['minid'])){ + $message[] = sprintf(_("The specified value for '%s' must be a numeric value"),_("GID / UID min id")); + } + return($message); } diff --git a/setup/class_setupStep6a.inc b/setup/class_setupStep6a.inc index 35f981615..c2646799f 100644 --- a/setup/class_setupStep6a.inc +++ b/setup/class_setupStep6a.inc @@ -42,6 +42,17 @@ class setup_step_6a extends setup_step function setup_step_6a() { $this->update_strings(); + + /* Look for samba password generation method */ + if(file_exists("/usr/bin/mkntpasswd")){ + $pwdhash = "/usr/bin/mkntpasswd"; + } elseif (preg_match("/^Usage: mkntpwd /", shell_exec ("mkntpwd 2>&1"))){ + $pwdhash= "mkntpwd"; + } else { + $pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"'; + } + + $this->optional['smbhash'] = $pwdhash; } @@ -84,7 +95,7 @@ class setup_step_6a extends setup_step foreach(array("enableCopyPaste","forceglobals","forcessl","warnssl","compile","debuglevel","session_lifetime","smbhash") as $name){ if(isset($_POST[$name])){ - $this->optional[$name] = $_POST[$name]; + $this->optional[$name] = stripslashes($_POST[$name]); } } @@ -129,6 +140,15 @@ class setup_step_6a extends setup_step function check() { $message = array(); + + if(!is_numeric( $this->optional['session_lifetime'])){ + $message[] = _("Session lifetime must be a numeric value."); + } + + if(!is_numeric( $this->optional['max_ldap_query_time'])){ + $message[] = _("Maximal ldap query time must be a numeric value. "); + } + return($message); } diff --git a/setup/setup_step6a.tpl b/setup/setup_step6a.tpl index de4d3da4d..b7db260a1 100644 --- a/setup/setup_step6a.tpl +++ b/setup/setup_step6a.tpl @@ -12,8 +12,6 @@ {t}Optional settings{/t} - -
{t}Enable Copy & Paste{/t} @@ -134,15 +132,22 @@
-
-
+
+
{t}SMB hash{/t}
-
- -
-
+
+   + /usr/bin/mkntpasswd
+   + mkntpwd
+   + perl -MCrypt::SmbHash ... +
+
{t}Infos in FAQ{/t} 
-- 2.30.2