From 45fb5caa78afdedbc5616d9ce1ec6bfc8a367f05 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Wed, 16 Jun 2010 14:28:42 +0000 Subject: [PATCH] Implemented: FS#1056 - Webftp link like phpmyadmin or webmail --- install/tpl/system.ini.master | 1 + .../web/admin/form/system_config.tform.php | 12 +++++++++ .../web/admin/lib/lang/en_system_config.lng | 1 + .../templates/system_config_sites_edit.htm | 14 ++++++---- interface/web/sites/ftp_user_list.php | 27 ++++++++++++++++--- .../web/sites/templates/ftp_user_list.htm | 3 ++- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master index bf85ec514..3124d92b3 100644 --- a/install/tpl/system.ini.master +++ b/install/tpl/system.ini.master @@ -20,6 +20,7 @@ shelluser_prefix=[CLIENTNAME] webdavuser_prefix=[CLIENTNAME] dblist_phpmyadmin_link=y phpmyadmin_url= +webftp_url= [tools] diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index b77640064..828b390fd 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -136,6 +136,18 @@ $form["tabs"]['sites'] = array ( 'width' => '30', 'maxlength' => '255' ), + 'webftp_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', + 'errmsg'=> 'webftp_url_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), ################################## # 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 69957ce7b..b3f4fb4d8 100644 --- a/interface/web/admin/lib/lang/en_system_config.lng +++ b/interface/web/admin/lib/lang/en_system_config.lng @@ -18,4 +18,5 @@ $wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL'; $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'; ?> \ No newline at end of file diff --git a/interface/web/admin/templates/system_config_sites_edit.htm b/interface/web/admin/templates/system_config_sites_edit.htm index 9dc8d1beb..63a4a4f23 100644 --- a/interface/web/admin/templates/system_config_sites_edit.htm +++ b/interface/web/admin/templates/system_config_sites_edit.htm @@ -25,16 +25,20 @@ -
-

{tmpl_var name='dblist_phpmyadmin_link_txt'}

-
- {tmpl_var name='dblist_phpmyadmin_link'} -
+
+

{tmpl_var name='dblist_phpmyadmin_link_txt'}

+
+ {tmpl_var name='dblist_phpmyadmin_link'}
+
+
+ + +
diff --git a/interface/web/sites/ftp_user_list.php b/interface/web/sites/ftp_user_list.php index f16f5f266..ef94dc246 100644 --- a/interface/web/sites/ftp_user_list.php +++ b/interface/web/sites/ftp_user_list.php @@ -44,12 +44,31 @@ $list_def_file = "list/ftp_user.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 = 'subdomain'"; -$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['webftp_url'] != '') { + $app->tpl->setVar('webftp_link',1); + $app->tpl->setVar('webftp_url',$global_config['webftp_url']); + } else { + $app->tpl->setVar('webftp_link',0); + } + + parent::onShow(); + } + +} + +$list = new list_action; +$list->onLoad(); ?> \ No newline at end of file diff --git a/interface/web/sites/templates/ftp_user_list.htm b/interface/web/sites/templates/ftp_user_list.htm index 1fbda08ed..e0e51a245 100644 --- a/interface/web/sites/templates/ftp_user_list.htm +++ b/interface/web/sites/templates/ftp_user_list.htm @@ -41,7 +41,8 @@ {tmpl_var name="username"} -- GitLab