Skip to content

Commit 45fb5ca

Browse files
committed
Implemented: FS#1056 - Webftp link like phpmyadmin or webmail
1 parent eccb77f commit 45fb5ca

File tree

6 files changed

+48
-10
lines changed

6 files changed

+48
-10
lines changed

install/tpl/system.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ shelluser_prefix=[CLIENTNAME]
2020
webdavuser_prefix=[CLIENTNAME]
2121
dblist_phpmyadmin_link=y
2222
phpmyadmin_url=
23+
webftp_url=
2324

2425
[tools]
2526

interface/web/admin/form/system_config.tform.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@
136136
'width' => '30',
137137
'maxlength' => '255'
138138
),
139+
'webftp_url' => array (
140+
'datatype' => 'VARCHAR',
141+
'formtype' => 'TEXT',
142+
'validators' => array ( 0 => array ( 'type' => 'REGEX',
143+
'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/',
144+
'errmsg'=> 'webftp_url_error_regex'),
145+
),
146+
'default' => '',
147+
'value' => '',
148+
'width' => '30',
149+
'maxlength' => '255'
150+
),
139151
##################################
140152
# ENDE Datatable fields
141153
##################################

interface/web/admin/lib/lang/en_system_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ $wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL';
1818
$wb['use_domain_module_txt'] = 'Use the domain-module to add new domains';
1919
$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.';
2020
$wb['new_domain_txt'] = 'HTML to create a new domain';
21+
$wb['webftp_url_txt'] = 'WebFTP URL';
2122
?>

interface/web/admin/templates/system_config_sites_edit.htm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@ <h2><tmpl_var name="list_head_txt"></h2>
2525
<label for="webdavuser_prefix">{tmpl_var name='webdavuser_prefix_txt'}</label>
2626
<input name="webdavuser_prefix" id="webdavuser_prefix" value="{tmpl_var name='webdavuser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
2727
</div>
28-
<div class="ctrlHolder">
29-
<p class="label">{tmpl_var name='dblist_phpmyadmin_link_txt'}</p>
30-
<div class="multiField">
31-
{tmpl_var name='dblist_phpmyadmin_link'}
32-
</div>
28+
<div class="ctrlHolder">
29+
<p class="label">{tmpl_var name='dblist_phpmyadmin_link_txt'}</p>
30+
<div class="multiField">
31+
{tmpl_var name='dblist_phpmyadmin_link'}
3332
</div>
33+
</div>
3434
<div class="ctrlHolder">
3535
<label for="phpmyadmin_url">{tmpl_var name='phpmyadmin_url_txt'}</label>
3636
<input name="phpmyadmin_url" id="phpmyadmin_url" value="{tmpl_var name='phpmyadmin_url'}" size="30" maxlength="255" type="text" class="textInput" />
3737
</div>
38+
<div class="ctrlHolder">
39+
<label for="webftp_url">{tmpl_var name='webftp_url_txt'}</label>
40+
<input name="webftp_url" id="webftp_url" value="{tmpl_var name='webftp_url'}" size="30" maxlength="255" type="text" class="textInput" />
41+
</div>
3842
</fieldset>
3943

4044
<input type="hidden" name="id" value="{tmpl_var name='id'}">

interface/web/sites/ftp_user_list.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,31 @@
4444
//* Check permissions for module
4545
$app->auth->check_module_permissions('sites');
4646

47-
$app->uses('listform_actions');
47+
$app->load('listform_actions');
4848

49-
// Limit the results to alias domains
50-
//$app->listform_actions->SQLExtWhere = "type = 'subdomain'";
5149

52-
$app->listform_actions->onLoad();
50+
class list_action extends listform_actions {
51+
52+
function onShow() {
53+
global $app,$conf;
54+
55+
$app->uses('getconf');
56+
$global_config = $app->getconf->get_global_config('sites');
57+
58+
if($global_config['webftp_url'] != '') {
59+
$app->tpl->setVar('webftp_link',1);
60+
$app->tpl->setVar('webftp_url',$global_config['webftp_url']);
61+
} else {
62+
$app->tpl->setVar('webftp_link',0);
63+
}
64+
65+
parent::onShow();
66+
}
67+
68+
}
69+
70+
$list = new list_action;
71+
$list->onLoad();
5372

5473

5574
?>

interface/web/sites/templates/ftp_user_list.htm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ <h2><tmpl_var name="list_head_txt"></h2>
4141
<td class="tbl_col_username"><a href="#" onClick="loadContent('sites/ftp_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="username"}</a></td>
4242
<td class="tbl_col_buttons">
4343
<div class="buttons icons16">
44-
<a class="icons16 icoDelete" href="javascript: del_record('sites/ftp_user_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
44+
<tmpl_if name="webftp_link"><a class="icons16 icoDbAdmin" href="{tmpl_var name='webftp_url'}" target="_blank"><span>{tmpl_var name='admin_txt'}</span></a></tmpl_if>
45+
<a class="icons16 icoDelete" href="javascript: del_record('sites/ftp_user_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
4546
</div>
4647
</td>
4748
</tr>

0 commit comments

Comments
 (0)