From d88165c8c17e6ff6860cf113b486108ba6d45e6c Mon Sep 17 00:00:00 2001 From: filip Date: Tue, 12 Oct 2010 10:46:36 +0000 Subject: [PATCH] Added admin_name and admin_email to mail system config tab. Using these variables in welcome email from admin, when mailbox is created. --- .../web/admin/form/system_config.tform.php | 18 +++++++++++++++++- .../web/admin/lib/lang/cz_system_config.lng | 2 ++ .../web/admin/lib/lang/en_system_config.lng | 2 ++ .../templates/system_config_mail_edit.htm | 8 ++++++++ interface/web/mail/mail_user_edit.php | 6 ++++++ 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index 2c0138eb2b..db43fc8187 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -180,6 +180,22 @@ $form["tabs"]['mail'] = array ( 'width' => '30', 'maxlength' => '255' ), + 'admin_mail' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'admin_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), ################################## # ENDE Datatable fields ################################## @@ -233,4 +249,4 @@ $form["tabs"]['misc'] = array ( ); -?> \ No newline at end of file +?> diff --git a/interface/web/admin/lib/lang/cz_system_config.lng b/interface/web/admin/lib/lang/cz_system_config.lng index 39eb7ff727..b8f55eeadb 100644 --- a/interface/web/admin/lib/lang/cz_system_config.lng +++ b/interface/web/admin/lib/lang/cz_system_config.lng @@ -19,4 +19,6 @@ $wb['use_domain_module_txt'] = 'Use the domain-module to add new domains'; $wb['use_domain_module_hint'] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They can not free edit the domain-field.You have to re-login after changing this value, to make the changes visible.'; $wb['new_domain_txt'] = 'HTML to create a new domain'; $wb['webftp_url_txt'] = 'WebFTP URL'; +$wb['admin_mail_txt'] = 'E-mail Administrátora'; +$wb['admin_name_txt'] = 'Jméno Administrátora'; ?> diff --git a/interface/web/admin/lib/lang/en_system_config.lng b/interface/web/admin/lib/lang/en_system_config.lng index 5d891644e0..d75d1a7bda 100644 --- a/interface/web/admin/lib/lang/en_system_config.lng +++ b/interface/web/admin/lib/lang/en_system_config.lng @@ -19,4 +19,6 @@ $wb["use_domain_module_txt"] = 'Use the domain-module to add new domains'; $wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.'; $wb["new_domain_txt"] = 'HTML to create a new domain'; $wb["webftp_url_txt"] = 'WebFTP URL'; +$wb['admin_mail_txt'] = 'Administrator's e-mail'; +$wb['admin_name_txt'] = 'Administrator's name'; ?> diff --git a/interface/web/admin/templates/system_config_mail_edit.htm b/interface/web/admin/templates/system_config_mail_edit.htm index 776c513b15..41ba4cd052 100644 --- a/interface/web/admin/templates/system_config_mail_edit.htm +++ b/interface/web/admin/templates/system_config_mail_edit.htm @@ -15,6 +15,14 @@ +
+ + +
+
+ + +
diff --git a/interface/web/mail/mail_user_edit.php b/interface/web/mail/mail_user_edit.php index 3bda44205f..11daf7a3bb 100644 --- a/interface/web/mail/mail_user_edit.php +++ b/interface/web/mail/mail_user_edit.php @@ -242,6 +242,12 @@ class page_action extends tform_actions { $welcomeFromName = $app->tform->lng("welcome_mail_fromname_txt"); $welcomeFromEmail = $app->tform->lng("welcome_mail_fromemail_txt"); + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('mail'); + if(!empty($global_config['admin_mail']))$welcomeFromEmail = $global_config['admin_mail']; + if(!empty($global_config['admin_name']))$welcomeFromName = $global_config['admin_name']; + $mailHeaders = "MIME-Version: 1.0" . "\n"; $mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n"; $mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n"; -- GitLab