Skip to content

Commit 310ec5c

Browse files
committed
Fixed: FS#670 - Changing ftp_user_prefix and shell_user_prefix not possible
1 parent e4baff7 commit 310ec5c

File tree

2 files changed

+232
-226
lines changed

2 files changed

+232
-226
lines changed

interface/web/sites/ftp_user_edit.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ function onShowEnd() {
8282

8383
$app->uses('getconf');
8484
$global_config = $app->getconf->get_global_config('sites');
85-
$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
85+
// $ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
86+
$ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
8687

8788
if ($this->dataRecord['username'] != ""){
8889
/* REMOVE the restriction */
@@ -115,7 +116,8 @@ function onBeforeInsert() {
115116

116117
$app->uses('getconf');
117118
$global_config = $app->getconf->get_global_config('sites');
118-
$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
119+
//$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
120+
$ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
119121

120122
if ($app->tform->errorMessage == '') {
121123
$this->dataRecord['username'] = $ftpuser_prefix . $this->dataRecord['username'];
@@ -151,7 +153,8 @@ function onBeforeUpdate() {
151153

152154
$app->uses('getconf');
153155
$global_config = $app->getconf->get_global_config('sites');
154-
$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
156+
//$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
157+
$ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
155158

156159
/* restrict the names */
157160
if ($app->tform->errorMessage == '') {

0 commit comments

Comments
 (0)