From: hickert Date: Thu, 14 Feb 2008 12:23:03 +0000 (+0000) Subject: Updated Setup. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e95ad841a6101e0da3edc5e3ba5610e22c059722;p=gosa.git Updated Setup. -Added mail_attrib option -Allows to set another mail account identification attribute (uid,mail) as predifined in the mailMethod. Default is read form the mailMethod. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8903 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 7f96d76f7..df101184d 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -504,6 +504,7 @@ {else} cyrusunixstyle="false" {/if} + mail_uattrib="{$cv.mail_attrib}" {if $cv.mail_settings.vacationdir_active} vacationdir="{$cv.mail_settings.vacationdir}" {/if} diff --git a/setup/class_setupStep_Config2.inc b/setup/class_setupStep_Config2.inc index 26f78ea9b..cf99dbb16 100644 --- a/setup/class_setupStep_Config2.inc +++ b/setup/class_setupStep_Config2.inc @@ -27,10 +27,11 @@ class Step_Config2 extends setup_step var $header_image = "images/ldapserver.png"; var $cyrusunixstyle = FALSE; - var $mail = "none"; + var $mail = "none"; var $mail_methods = array(); - var $mail_settings = array("vacationdir" => "/etc/gosa/vacation", + var $mail_settings = array("vacationdir" => "/etc/gosa/vacation", "vacationdir_active" => FALSE); + var $mail_attrib = "mail"; var $generic_settings = array( "enableCopyPaste" => false, @@ -53,16 +54,13 @@ class Step_Config2 extends setup_step var $timezone = "Europe/Berlin"; var $timezones = array(); - var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone","enableMimeType"); + var $attributes = array("mail_attrib","governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone","enableMimeType"); var $called = FALSE; function Step_Config2() { $this->update_strings(); - $tmp = $this->get_available_mail_classes(); - foreach($tmp['name'] as $name){ - $this->mail_methods[$name] = $name; - } + $this->mail_methods = $this->get_available_mail_classes(); /* Look for samba password generation method */ if(file_exists("/usr/bin/mkntpasswd")){ @@ -144,7 +142,7 @@ class Step_Config2 extends setup_step $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){ + foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); } $smarty->assign("timezone" ,$this->timezone); @@ -160,6 +158,8 @@ class Step_Config2 extends setup_step $this->timezone = $_POST['timezone']; } + $old_mail = $this->mail; + /* Get attributes */ foreach($this->attributes as $attr){ if(isset($_POST[$attr])){ @@ -229,6 +229,11 @@ class Step_Config2 extends setup_step }else{ $this->is_completed = FALSE; } + + /* Reload mail naming attribute */ + if($old_mail != $this->mail && isset($this->mail_methods[$this->mail]['uattrib'])){ + $this->mail_attrib = $this->mail_methods[$this->mail]['uattrib']; + } } @@ -258,16 +263,28 @@ class Step_Config2 extends setup_step $lensuf = strlen($suffix); $prefix = ".inc"; $lenpre = strlen($prefix); - $i = 0; - while (($file = readdir($dir)) !== false){ + $default_uattrib = ""; + $m_class_vars = get_class_vars("mailMethod"); + if(isset($m_class_vars['uattrib'])){ + $default_uattrib = $m_class_vars['uattrib']; + } + + while (($file = readdir($dir)) !== false){ if(stristr($file,$suffix)) { + + require_once($file); $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++; + $name = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre); + $methods[$name]['file'] = $file; + $methods[$name]['name'] = $name; + + $m_class_vars = get_class_vars("mailMethod".$methods[$name]['name']); + if(isset($m_class_vars['uattrib'])){ + $methods[$name]['uattrib'] = $m_class_vars['uattrib']; + }else{ + $methods[$name]['uattrib'] = $default_uattrib; + } } } return($methods); diff --git a/setup/setup_config2.tpl b/setup/setup_config2.tpl index dd8b239a4..fd461880e 100644 --- a/setup/setup_config2.tpl +++ b/setup/setup_config2.tpl @@ -183,15 +183,33 @@ {t}Mail method{/t}
- + + {foreach from=$mail_methods item=item} + + {/foreach}
+
+
+ {t}Account identification attribute{/t} +
+
+ +
+
+
+
+ + +
{t}Vacation templates{/t}