From d8b8b07743627b8280d722c32215852204317401 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Mon, 15 Dec 2008 12:08:56 +0000 Subject: [PATCH] Made links to phpmyadmin and webmail in the database and mailbox lists configurable. --- install/tpl/system.ini.master | 2 + .../lib/classes/listform_actions.inc.php | 2 +- .../web/admin/form/system_config.tform.php | 26 ++++ .../web/admin/lib/lang/en_system_config.lng | 2 + interface/web/admin/system_config_edit.php | 4 +- .../templates/system_config_mail_edit.htm | 22 ++++ .../templates/system_config_sites_edit.htm | 72 ++++++----- interface/web/mail/mail_user_list.php | 27 +++- .../web/mail/templates/mail_user_list.htm | 108 ++++++++-------- interface/web/sites/database_list.php | 25 +++- .../web/sites/templates/database_list.htm | 120 +++++++++--------- interface/web/sites/web_domain_list.php | 12 +- 12 files changed, 262 insertions(+), 160 deletions(-) create mode 100644 interface/web/admin/templates/system_config_mail_edit.htm diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master index 2ef756e1a..27f517617 100644 --- a/install/tpl/system.ini.master +++ b/install/tpl/system.ini.master @@ -7,6 +7,7 @@ [dns] [mail] +mailboxlist_webmail_link=y [monitor] @@ -15,5 +16,6 @@ dbname_prefix=[CLIENTNAME]_ dbuser_prefix=[CLIENTNAME] ftpuser_prefix=[CLIENTNAME] shelluser_prefix=[CLIENTNAME] +dblist_phpmyadmin_link=y [tools] \ No newline at end of file diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php index e57051415..26abeefd8 100644 --- a/interface/lib/classes/listform_actions.inc.php +++ b/interface/lib/classes/listform_actions.inc.php @@ -132,7 +132,7 @@ class listform_actions { } - private function onShow() + public function onShow() { global $app; diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index c74719cc3..fede652fb 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -106,6 +106,32 @@ $form["tabs"]['sites'] = array ( 'width' => '30', 'maxlength' => '255' ), + 'dblist_phpmyadmin_link' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +$form["tabs"]['mail'] = array ( + 'title' => "Mail", + 'width' => 70, + 'template' => "templates/system_config_mail_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'mailboxlist_webmail_link' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), ################################## # ENDE Datatable fields ################################## diff --git a/interface/web/admin/lib/lang/en_system_config.lng b/interface/web/admin/lib/lang/en_system_config.lng index 6214226e5..331747663 100644 --- a/interface/web/admin/lib/lang/en_system_config.lng +++ b/interface/web/admin/lib/lang/en_system_config.lng @@ -9,5 +9,7 @@ $wb['dbname_prefix_error_regex'] = 'Char not allowed in database name prefix.'; $wb['dbuser_prefix_error_regex'] = 'Char not allowed in database user prefix.'; $wb['ftpuser_prefix_error_regex'] = 'Char not allowed in ftp user prefix.'; $wb['shelluser_prefix_error_regex'] = 'Char not allowed in shell user prefix.'; +$wb['dblist_phpmyadmin_link_txt'] = 'Link to phpmyadmin in DB list'; +$wb['mailboxlist_webmail_link_txt'] = 'Link to webmail in Mailbox list'; ?> \ No newline at end of file diff --git a/interface/web/admin/system_config_edit.php b/interface/web/admin/system_config_edit.php index 62ffef5b7..6107f20e4 100644 --- a/interface/web/admin/system_config_edit.php +++ b/interface/web/admin/system_config_edit.php @@ -62,6 +62,7 @@ class page_action extends tform_actions { $server_id = $this->id; $this->dataRecord = $app->getconf->get_global_config($section); + } $record = $app->tform->getHTML($this->dataRecord, $this->active_tab,'EDIT'); @@ -78,9 +79,8 @@ class page_action extends tform_actions { $app->uses('ini_parser,getconf'); $section = $app->tform->getCurrentTab(); - $server_id = $this->id; - $server_config_array = $app->getconf->get_global_config($server_id); + $server_config_array = $app->getconf->get_global_config(); $server_config_array[$section] = $app->tform->encode($this->dataRecord,$section); $server_config_str = $app->ini_parser->get_ini_string($server_config_array); diff --git a/interface/web/admin/templates/system_config_mail_edit.htm b/interface/web/admin/templates/system_config_mail_edit.htm new file mode 100644 index 000000000..5dd2dc3ea --- /dev/null +++ b/interface/web/admin/templates/system_config_mail_edit.htm @@ -0,0 +1,22 @@ +

+ +
+ +
+
Mail + + + {tmpl_var name='mailboxlist_webmail_link'} + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/system_config_sites_edit.htm b/interface/web/admin/templates/system_config_sites_edit.htm index d605962aa..8120d4caf 100644 --- a/interface/web/admin/templates/system_config_sites_edit.htm +++ b/interface/web/admin/templates/system_config_sites_edit.htm @@ -1,34 +1,38 @@ -

- -
- -
-
Sites -

{tmpl_var name='warning'}

- - - - - - - - - - - - - - - - -
- - - -
- - -
-
- -
+

+ +
+ +
+
Sites + + + + + + + + + + + + + + + + + + + {tmpl_var name='dblist_phpmyadmin_link'} + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/mail_user_list.php b/interface/web/mail/mail_user_list.php index 7e728afe9..1cc8554da 100644 --- a/interface/web/mail/mail_user_list.php +++ b/interface/web/mail/mail_user_list.php @@ -15,9 +15,30 @@ $list_def_file = "list/mail_user.list.php"; //* Check permissions for module $app->auth->check_module_permissions('mail'); -$app->uses('listform_actions'); - -$app->listform_actions->onLoad(); +$app->load('listform_actions'); + + +class list_action extends listform_actions { + + function onShow() { + global $app,$conf; + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('mail'); + + if($global_config['mailboxlist_webmail_link'] == 'y') { + $app->tpl->setVar('mailboxlist_webmail_link',1); + } else { + $app->tpl->setVar('mailboxlist_webmail_link',0); + } + + parent::onShow(); + } + +} + +$list = new list_action; +$list->onLoad(); ?> \ No newline at end of file diff --git a/interface/web/mail/templates/mail_user_list.htm b/interface/web/mail/templates/mail_user_list.htm index 9b2e1c08a..ce15a4298 100644 --- a/interface/web/mail/templates/mail_user_list.htm +++ b/interface/web/mail/templates/mail_user_list.htm @@ -1,54 +1,54 @@ -

- -
- -
-
Tools -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="email"}{tmpl_var name="autoresponder"} - -
-
-
- -
+

+ +
+ +
+
Tools +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="email"}{tmpl_var name="autoresponder"} + +
+
+
+ +
diff --git a/interface/web/sites/database_list.php b/interface/web/sites/database_list.php index 5be0ccf81..9ced595f4 100644 --- a/interface/web/sites/database_list.php +++ b/interface/web/sites/database_list.php @@ -44,9 +44,30 @@ $list_def_file = "list/database.list.php"; //* Check permissions for module $app->auth->check_module_permissions('sites'); -$app->uses('listform_actions'); +$app->load('listform_actions'); -$app->listform_actions->onLoad(); + +class list_action extends listform_actions { + + function onShow() { + global $app,$conf; + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + + if($global_config['dblist_phpmyadmin_link'] == 'y') { + $app->tpl->setVar('dblist_phpmyadmin_link',1); + } else { + $app->tpl->setVar('dblist_phpmyadmin_link',0); + } + + parent::onShow(); + } + +} + +$list = new list_action; +$list->onLoad(); ?> \ No newline at end of file diff --git a/interface/web/sites/templates/database_list.htm b/interface/web/sites/templates/database_list.htm index bebdd0a6f..3e721c2fe 100644 --- a/interface/web/sites/templates/database_list.htm +++ b/interface/web/sites/templates/database_list.htm @@ -1,60 +1,60 @@ -

- -
- -
-
Tools -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="active"}{tmpl_var name="remote_access"}{tmpl_var name="server_id"}{tmpl_var name="database_name"} - -
-
-
- -
+

+ +
+ +
+
Tools +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="remote_access"}{tmpl_var name="server_id"}{tmpl_var name="database_name"} + +
+
+
+ +
diff --git a/interface/web/sites/web_domain_list.php b/interface/web/sites/web_domain_list.php index 3520c287c..da46e761c 100644 --- a/interface/web/sites/web_domain_list.php +++ b/interface/web/sites/web_domain_list.php @@ -44,12 +44,16 @@ $list_def_file = "list/web_domain.list.php"; //* Check permissions for module $app->auth->check_module_permissions('sites'); -$app->uses('listform_actions'); +$app->load('listform_actions'); -// Limit the results to alias domains -$app->listform_actions->SQLExtWhere = "type = 'vhost'"; -$app->listform_actions->onLoad(); +class list_action extends listform_actions { + +} + +$list = new list_action; +$list->SQLExtWhere = "type = 'vhost'"; +$list->onLoad(); ?> \ No newline at end of file -- GitLab