Code

Updated styles
[gosa.git] / setup / class_setupStep_Config2.inc
index 2e5039d76de2ac4a294897d20cd7e0e8a4a4eee8..8f3e499a73b0f7d0c1fc6b0aaf3f983a02b972f3 100644 (file)
 
 class Step_Config2 extends setup_step
 {
-  var $strict         = TRUE;
   var $governmentmode = FALSE;
   var $sambaidmapping = FALSE;
-  var $minid          = 100;       
-  var $account_expiration  =FALSE;
   var $header_image = "images/ldapserver.png";
 
-  var $generic_settings  = array( "idgen"         => "{%sn}-{%givenName[2-4]}",
-                                  "idgen_active"  => FALSE,
-                                  "minid"         => "100",
-                                  "minid_active"  => FALSE,
+  var $cyrusunixstyle = FALSE;
+  var $mail       = "none";
+  var $mail_methods   = array();
+  var $mail_settings = array("vacationdir"        => "/etc/gosa/vacation",
+                             "vacationdir_active" => FALSE);
+
+  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%");
@@ -46,11 +45,16 @@ class Step_Config2 extends setup_step
                                   "samba_sid_active" => FALSE,
                                   "samba_rid"        => 1000,
                                   "samba_rid_active" => FALSE); 
-  var $attributes = array("strict","governmentmode","sambaidmapping","account_expiration");
+
+  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
 
   function Step_Config2()
   {
     $this->update_strings();
+    $tmp = $this->get_available_mail_classes();
+    foreach($tmp['name'] as $name){
+      $this->mail_methods[$name] = $name;
+    }
   }
 
  
@@ -66,7 +70,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]);
@@ -77,6 +81,8 @@ class Step_Config2 extends setup_step
 
     $smarty = get_smarty();
     $smarty->assign("generic_settings",$this->generic_settings);
+    $smarty->assign("mail_settings",$this->mail_settings);
+    $smarty->assign("mail_methods",$this->mail_methods);
     $smarty->assign("samba_settings",$this->samba_settings);
     $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes")));
         foreach($this->attributes as $attr){
@@ -96,13 +102,18 @@ class Step_Config2 extends setup_step
         }
       }
 
-      if(isset($_POST['minid_active'])){
-        $this->generic_settings['minid_active'] = TRUE;
-        if(isset($_POST['minid'])){
-          $this->generic_settings['minid'] = $_POST['minid'];
+      /* Mail settings */
+      if(isset($_POST['vacationdir_active'])){
+        $this->mail_settings['vacationdir_active'] = TRUE;
+        if(isset($_POST['vacationdir'])){
+          $this->mail_settings['vacationdir'] = $_POST['vacationdir'];
         }
       }else{
-        $this->generic_settings['minid_active'] = FALSE;
+        $this->mail_settings['vacationdir_active'] = FALSE;
+      }
+
+      if(isset($_POST['enableCopyPaste'])){
+        $this->generic_settings['enableCopyPaste'] = $_POST['enableCopyPaste'];
       }
 
       if(isset($_POST['wws_ou_active'])){
@@ -114,15 +125,6 @@ class Step_Config2 extends setup_step
         $this->generic_settings['wws_ou_active'] = FALSE;
       }
 
-      /* Generic settings */
-      if(isset($_POST['idgen_active'])){
-        $this->generic_settings['idgen_active'] = TRUE;
-        if(isset($_POST['idgen'])){
-          $this->generic_settings['idgen'] = $_POST['idgen'];
-        }
-      }else{
-        $this->generic_settings['idgen_active'] = FALSE;
-      }
       if(isset($_POST['snapshot_active'])){
         $this->generic_settings['snapshot_active'] = TRUE;
         if(isset($_POST['snapshot_base'])){
@@ -137,9 +139,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;
       }
@@ -176,11 +175,6 @@ class Step_Config2 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);
   }
   
@@ -189,12 +183,36 @@ class Step_Config2 extends setup_step
   function get_attributes()
   {
     $tmp = setup_step::get_attributes();
-    foreach(array("samba_settings","generic_settings") as $attr){
+    foreach(array("samba_settings","generic_settings","mail_settings") as $attr){
       $tmp[$attr]= $this->$attr;
     }
     return($tmp);
   }
 
+/* Returns the classnames auf the mail classes */
+  function get_available_mail_classes()
+  {
+    $dir = opendir( "../include");
+    $methods = array();
+    $suffix = "class_mail-methods-";
+    $lensuf = strlen($suffix);
+    $prefix = ".inc";
+    $lenpre = strlen($prefix);
+    $i = 0;
+    while (($file = readdir($dir)) !== false){
+
+      if(stristr($file,$suffix)) {
+        $lenfile = strlen($file);
+        $methods['name'][$i] = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre);
+        $methods['file'][$i] = $file;
+        $methods[$i]['file'] = $file;
+        $methods[$i]['name'] = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre);
+        $i++;
+      }
+    }
+    return($methods);
+  }
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: