Code

Added initial department migration step.
[gosa.git] / setup / class_setupStep_Config2.inc
index 5023cec51060cd006607ca6e4702cad409baf3ea..8eab8885f68696eb644f538ff0bad3ff01c94abf 100644 (file)
@@ -24,7 +24,6 @@ class Step_Config2 extends setup_step
 {
   var $governmentmode = FALSE;
   var $sambaidmapping = FALSE;
-  var $strict         = TRUE;
   var $header_image = "images/ldapserver.png";
 
   var $cyrusunixstyle = FALSE;
@@ -33,11 +32,11 @@ class Step_Config2 extends setup_step
   var $mail_settings = array("vacationdir"        => "/etc/gosa/vacation",
                              "vacationdir_active" => FALSE);
 
-  var $generic_settings  = array( "wws_ou"        => "ou=winstations",
+  var $generic_settings  = array( "enableCopyPaste" => false,
+                                  "wws_ou"        => "ou=winstations",
                                   "wws_ou_active" => FALSE,
                                   "snapshot_active"     => FALSE,
                                   "snapshot_base"       => "ou=snapshots,%base%",
-                                  "snapshot_ldap_base"  => "%base%",
                                   "snapshot_user"       => "cn=ldapadmin,%base%",
                                   "snapshot_password"   => "",
                                   "snapshot_server"     => "%connection%");
@@ -45,9 +44,10 @@ 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("strict","governmentmode","sambaidmapping","cyrusunixstyle","mail");
+  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
 
   function Step_Config2()
   {
@@ -56,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;
   }
 
  
@@ -71,7 +82,7 @@ class Step_Config2 extends setup_step
   {
     /* Update snapshot values, with already collected values */
     foreach($this->generic_settings as $key => $value){
-      foreach(array("snapshot_ldap_base","snapshot_base","snapshot_user","snapshot_server") as $attr){
+      foreach(array("snapshot_base","snapshot_user","snapshot_server") as $attr){
         foreach($this->parent->captured_values as $replace_name => $replace_value){
           if(is_string($replace_value))  {
             $this->generic_settings[$attr] = preg_replace("/%".$replace_name."%/",$replace_value,$this->generic_settings[$attr]);
@@ -113,6 +124,10 @@ class Step_Config2 extends setup_step
         $this->mail_settings['vacationdir_active'] = FALSE;
       }
 
+      if(isset($_POST['enableCopyPaste'])){
+        $this->generic_settings['enableCopyPaste'] = $_POST['enableCopyPaste'];
+      }
+
       if(isset($_POST['wws_ou_active'])){
         $this->generic_settings['wws_ou_active'] = TRUE;
         if(isset($_POST['wws_ou'])){
@@ -136,9 +151,6 @@ class Step_Config2 extends setup_step
         if(isset($_POST['snapshot_server'])){
           $this->generic_settings['snapshot_server'] = $_POST['snapshot_server'];
         }
-        if(isset($_POST['snapshot_ldap_base'])){
-          $this->generic_settings['snapshot_ldap_base'] = $_POST['snapshot_ldap_base'];
-        }
       }else{
         $this->generic_settings['snapshot_active'] = FALSE;
       }
@@ -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'];
+      }
 
     }