diff --git a/gosa-core/setup/class_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc
index 9389964118d9f12e478385deb8920ea0e2ce18ca..89103e75b082f0ac404dd3bd16d54c6997d7efb2 100644 (file)
var $header_image = "images/ldapserver.png";
var $cyrusunixstyle = FALSE;
- var $mail = "none";
+ var $mail = "none";
+ var $mail_attrib = "";
var $mail_methods = array();
var $mail_settings = array("vacationdir" => "/etc/gosa/vacation",
"vacationdir_active" => FALSE);
"snapshot_base" => "ou=snapshots,%base%",
"snapshot_user" => "%admin%",
"snapshot_password" => "",
+ "logging" => "syslog,mysql",
"snapshot_server" => "%connection%");
var $samba_settings = array( "samba_sid" => "0-815-4711",
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")){
function execute()
{
+ $this->mail_methods = $this->get_available_mail_classes();
/* On first call check for rid/sid base */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$ldap->cd($cv['base']);
$ldap->search("(objectClass=sambaDomain)",array("dn"));
if($ldap->count()){
}
$smarty = get_smarty();
- $smarty->assign("sambaDomain_found",$this->sambaDomain_found);
- $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("sambaDomain_found", $this->sambaDomain_found);
+ $smarty->assign("generic_settings", reverse_html_entities($this->generic_settings));
+ $smarty->assign("mail_settings", reverse_html_entities($this->mail_settings));
+ $smarty->assign("mail_methods", reverse_html_entities($this->mail_methods));
+ $smarty->assign("samba_settings", reverse_html_entities($this->samba_settings));
+
+ $smarty->assign("logging_mysql" ,preg_match("/mysql/",$this->generic_settings['logging']));
+ $smarty->assign("logging_syslog",preg_match("/syslog/",$this->generic_settings['logging']));
+
$smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes")));
- foreach($this->attributes as $attr){
- $smarty->assign($attr,$this->$attr);
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,reverse_html_entities($this->$attr));
}
$smarty->assign("timezone" ,$this->timezone);
$smarty->assign("timezones" ,$this->timezones);
$this->timezone = $_POST['timezone'];
}
+ $old_mail = $this->mail;
+
/* Get attributes */
foreach($this->attributes as $attr){
if(isset($_POST[$attr])){
}
}
+ /* Get logging */
+ $logging = "";
+ if(isset($_POST['logging_syslog'])){
+ $logging.= "syslog,";
+ }
+ if(isset($_POST['logging_mysql'])){
+ $logging.= "mysql,";
+ }
+ $this->generic_settings['logging'] = trim($logging,",");
+
/* Mail settings */
if(isset($_POST['vacationdir_active'])){
$this->mail_settings['vacationdir_active'] = TRUE;
$this->samba_settings['samba_sid_active'] = TRUE;
$this->samba_settings['samba_rid_active'] = TRUE;
}
+
+ /* 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'];
+ }
}
$tmp = $this->check();
return($tmp);
}
-/* Returns the classnames auf the mail classes */
+
+ /* 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++;
+ global $class_mapping;
+
+ $default_uattrib = "";
+ $m_class_vars = get_class_vars("mailMethod");
+ if(isset($m_class_vars['uattrib'])){
+ $default_uattrib = $m_class_vars['uattrib'];
+ }
+
+ foreach($class_mapping as $name => $file){
+ if(preg_match("/^mailMethod[a-z]*$/i",$name)){
+ $name = preg_replace("/^mailMethod/","",$name);
+ if(!empty($name)){
+ $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);
}
-
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: