Code

Moved string up and open a new section
[gosa.git] / setup / class_setupStep_Config2.inc
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'];
+      }
 
     }