Code

Added some checks to attributes collected by setup.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 4 Apr 2007 10:14:38 +0000 (10:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 4 Apr 2007 10:14:38 +0000 (10:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5975 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep5.inc
setup/class_setupStep6.inc
setup/class_setupStep6a.inc
setup/setup_step6a.tpl

index 01d6ed167c20db7323a6654cd55cbe5ca67af0fe..8b6acec6fba5674126e811647c8ca43b236db527 100644 (file)
@@ -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");
     }
index c9c61ec31333a90138809f8e76137ecbfef3365c..30dd7f931cacdd233eb14bc44ef6f573d99fff19 100644 (file)
@@ -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);
   }
   
index 35f9816155ca357ac9061d8ac69b058a751430a3..c2646799ff0976bdd7177ba40c3f38b78bdc4226 100644 (file)
@@ -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);
   }
   
index de4d3da4d5d41b63cffee661a474e284498a8127..b7db260a1710eaeca1b477d16a5104119ebbecef 100644 (file)
@@ -12,8 +12,6 @@
                <b>{t}Optional settings{/t}</b>
        </div>
 
-
-       
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Enable Copy & Paste{/t}
         </div>
     </div>
 
-    <div class='step4_container'>
-        <div class='step4_name'>
+    <div class='step4_container' style='height:5em;'>
+        <div class='step4_name' style='height:5em;'>
             {t}SMB hash{/t}
         </div>
-        <div class='step4_value'>
-                       <input style='width:90%' id='smbhash' name='smbhash' 
-                               type='text' value='{$optional.smbhash}'>
-        </div>
-        <div class='step4_status'>
+        <div class='step4_value' style='height:5em;'>
+                       <input {if $optional.smbhash == "/usr/bin/mkntpasswd"} checked {/if} 
+                               type='radio' name='smbhash' value='/usr/bin/mkntpasswd'>&nbsp;
+                               /usr/bin/mkntpasswd<br>
+                       <input {if $optional.smbhash == "mkntpwd"} checked {/if}
+                               type='radio' name='smbhash' value='mkntpwd'>&nbsp;
+                               mkntpwd<br>
+                       <input {if $optional.smbhash == 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"'} checked {/if}
+                               type='radio' name='smbhash' value='perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"'>&nbsp;
+                               perl -MCrypt::SmbHash ...
+        </div>
+        <div class='step4_status' style='height:5em;'>
             {t}Infos in FAQ{/t}&nbsp;
             <img class='center' src='images/info_small.png' title='{t}Please read the FAQ for more informations{/t}'>
         </div>