Code

Updated style and moved smbhash to samba
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 13:26:51 +0000 (13:26 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 13:26:51 +0000 (13:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6135 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Config2.inc
setup/class_setupStep_Config3.inc
setup/setup_config2.tpl
setup/setup_config3.tpl

index 8f3e499a73b0f7d0c1fc6b0aaf3f983a02b972f3..8eab8885f68696eb644f538ff0bad3ff01c94abf 100644 (file)
@@ -44,6 +44,7 @@ class Step_Config2 extends setup_step
   var $samba_settings    = array( "samba_sid"        => "0-815-4711",
                                   "samba_sid_active" => FALSE,
                                   "samba_rid"        => 1000,
+                                  "smbhash"          => 'SMBHASH',
                                   "samba_rid_active" => FALSE); 
 
   var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
@@ -55,6 +56,17 @@ class Step_Config2 extends setup_step
     foreach($tmp['name'] as $name){
       $this->mail_methods[$name] = $name;
     }
+
+    /* 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->samba_settings['smbhash'] = $pwdhash;
   }
 
  
@@ -160,6 +172,9 @@ class Step_Config2 extends setup_step
       }else{
         $this->samba_settings['samba_rid_active'] = FALSE;
       }
+      if(isset($_POST['smbhash'])){
+        $this->samba_settings['smbhash'] = $_POST['smbhash'];
+      }
 
     }
 
index 680fdebd79d2f67699b855b4d37758fff4253005..365a66ffe9644995900158865b4692ab4a8a1d94 100644 (file)
@@ -48,24 +48,12 @@ class Step_Config3 extends setup_step
               "kioskpath" => "/var/spool/kiosk",
               "kioskpath_active" => FALSE,
 
-              "noprimarygroup"  => FALSE,
-              "smbhash" => 'SMBHASH');
+              "noprimarygroup"  => FALSE);
 
 
   function Step_Config3()
   {
     $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;
   }
 
 
@@ -100,7 +88,7 @@ class Step_Config3 extends setup_step
         }
       }
       
-      foreach(array("strict_units","noprimarygroup","forceglobals","forcessl","warnssl","compile","debuglevel","session_lifetime","smbhash") as $name){
+      foreach(array("strict_units","noprimarygroup","forceglobals","forcessl","warnssl","compile","debuglevel","session_lifetime") as $name){
         if(isset($_POST[$name])){
           $this->optional[$name] = stripslashes($_POST[$name]);
         }
index 433ace1adb065f899f51309e52b8e7e47608883a..679fee9a273c2eb6d471c7ed93cd20a0f8cd2a1d 100644 (file)
@@ -1,5 +1,15 @@
 <div class='default' style='margin:12px; '>  
     <p><b>{t}Samba settings{/t}</b></p>
+
+    <div class='step4_container'>
+        <div class='step4_name'>
+            {t}Samba hash generator{/t}
+        </div>
+        <div class='step4_value'>
+                <input size=40 id='smbhash' name='smbhash' type='text' value='{$samba_settings.smbhash}'  >
+        </div>
+    </div>
+
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Samba SID{/t}
index f3155981b3798708903b0b6e661dee8cbebff664..89b7f9999e7fe12f6b6fd054743ee75148dda847 100644 (file)
         </div>
     </div>
 
-    <div class='step4_container' style='height:5em;'>
-        <div class='step4_name' style='height:5em;'>
-            {t}SMB hash{/t}
-        </div>
-        <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>
-
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Session lifetime{/t}