From c1d4c8664ae5ad6e37c85a7974bae0941a8bed57 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 Apr 2007 10:35:23 +0000 Subject: [PATCH] Moved mail settings to config step 2 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6119 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setupStep_Config1.inc | 55 +++---------------------------- setup/class_setupStep_Config2.inc | 50 ++++++++++++++++++++++++++-- setup/setup_config1.tpl | 44 ------------------------- setup/setup_config2.tpl | 51 ++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 97 deletions(-) diff --git a/setup/class_setupStep_Config1.inc b/setup/class_setupStep_Config1.inc index c2a0449b5..91bf20f8d 100644 --- a/setup/class_setupStep_Config1.inc +++ b/setup/class_setupStep_Config1.inc @@ -33,10 +33,8 @@ class Step_Config1 extends setup_step var $base_hook_active = FALSE; var $encryption = "crypt"; - var $mail = "none"; var $theme = "default"; var $errorlvl = FALSE; - var $cyrusunixstyle = FALSE; var $pwd_rules = array("pwminlen" => 6, "pwminlen_active" => FALSE, @@ -45,14 +43,9 @@ class Step_Config1 extends setup_step "externalpwdhook" => "/path/to/your/script username oldpassword newpassword", "externalpwdhook_active" => FALSE); - var $mail_settings = array("vacationdir" => "/etc/gosa/vacation", - "vacationdir_active" => FALSE); - var $crypt_methods = array(); - var $mail_methods = array(); - - var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","mail","theme","errorlvl","cyrusunixstyle", + var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","theme","errorlvl", "base_hook","base_hook_active"); function Step_Config1() @@ -63,10 +56,6 @@ class Step_Config1 extends setup_step foreach($tmp['name'] as $name){ $this->crypt_methods[$name] = $name; } - $tmp = $this->get_available_mail_classes(); - foreach($tmp['name'] as $name){ - $this->mail_methods[$name] = $name; - } } @@ -83,10 +72,8 @@ class Step_Config1 extends setup_step $smarty = get_smarty(); $smarty->assign("peopledns",array("uid","cn")); $smarty->assign("crypt_methods",$this->crypt_methods); - $smarty->assign("mail_methods",$this->mail_methods); $smarty->assign("themes",$this->get_themes()); $smarty->assign("pwd_rules",$this->pwd_rules); - $smarty->assign("mail_settings",$this->mail_settings); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); @@ -95,30 +82,6 @@ class Step_Config1 extends setup_step } - /* 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); - } - function get_themes() { $dir = opendir( "../ihtml/themes/"); @@ -187,17 +150,7 @@ class Step_Config1 extends setup_step $this->pwd_rules['pwminlen_active'] = FALSE; } - /* 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->mail_settings['vacationdir_active'] = FALSE; - } - - /* Mail settings */ + /* External pwd settings */ if(isset($_POST['externalpwdhook_active'])){ $this->pwd_rules['externalpwdhook_active'] = TRUE; if(isset($_POST['externalpwdhook'])){ @@ -207,7 +160,7 @@ class Step_Config1 extends setup_step $this->pwd_rules['externalpwdhook_active'] = FALSE; } - /* Mail settings */ + /* base hook settings */ if(isset($_POST['base_hook_active'])){ $this->pwd_rules['base_hook_active'] = TRUE; if(isset($_POST['base_hook'])){ @@ -231,7 +184,7 @@ class Step_Config1 extends setup_step function get_attributes() { $tmp = setup_step::get_attributes(); - foreach(array("pwd_rules","mail_settings") as $attr){ + foreach(array("pwd_rules") as $attr){ $tmp[$attr]= $this->$attr; } return($tmp); diff --git a/setup/class_setupStep_Config2.inc b/setup/class_setupStep_Config2.inc index 2e5039d76..7dbced6b9 100644 --- a/setup/class_setupStep_Config2.inc +++ b/setup/class_setupStep_Config2.inc @@ -29,6 +29,12 @@ class Step_Config2 extends setup_step var $account_expiration =FALSE; var $header_image = "images/ldapserver.png"; + 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( "idgen" => "{%sn}-{%givenName[2-4]}", "idgen_active" => FALSE, "minid" => "100", @@ -46,11 +52,15 @@ 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("strict","governmentmode","sambaidmapping","account_expiration","cyrusunixstyle","mail"); function Step_Config2() { $this->update_strings(); + $tmp = $this->get_available_mail_classes(); + foreach($tmp['name'] as $name){ + $this->mail_methods[$name] = $name; + } } @@ -77,6 +87,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,6 +108,16 @@ class Step_Config2 extends setup_step } } + /* 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->mail_settings['vacationdir_active'] = FALSE; + } + if(isset($_POST['minid_active'])){ $this->generic_settings['minid_active'] = TRUE; if(isset($_POST['minid'])){ @@ -189,12 +211,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: diff --git a/setup/setup_config1.tpl b/setup/setup_config1.tpl index 060571ba3..31b2ba89d 100644 --- a/setup/setup_config1.tpl +++ b/setup/setup_config1.tpl @@ -135,50 +135,6 @@ {/if} - -

{t}Mail settings{/t}

- -
-
- {t}Mail method{/t} -
-
- -
-
-
-
- -
-
- {t}Vacation templates{/t} -
-
- {if $mail_settings.vacationdir_active == FALSE} - - - {else} - - - {/if} -
-
- -
-
- {t}Use Cyrus UNIX style{/t} -
-
- -
-
-