Skip to content

Commit 01d133c

Browse files
committed
Fixed: FS#1328 - edit ftp/ssh user: mangled usernames with duplicate prefix
1 parent 28eadb7 commit 01d133c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

interface/web/sites/ftp_user_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function onShowEnd() {
8181

8282
if ($this->dataRecord['username'] != ""){
8383
/* REMOVE the restriction */
84-
$app->tpl->setVar("username", str_replace($ftpuser_prefix , '', $this->dataRecord['username']));
84+
$app->tpl->setVar("username", preg_replace('/'.$ftpuser_prefix.'/' , '', $this->dataRecord['username'], 1));
8585
}
8686
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
8787
$app->tpl->setVar("username_prefix", $global_config['ftpuser_prefix']);

interface/web/sites/shell_user_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function onShowEnd() {
8181

8282
if ($this->dataRecord['username'] != ""){
8383
/* REMOVE the restriction */
84-
$app->tpl->setVar("username", str_replace($shelluser_prefix , '', $this->dataRecord['username']));
84+
$app->tpl->setVar("username", preg_replace('/'.$shelluser_prefix.'/', '', $this->dataRecord['username'], 1));
8585
}
8686
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
8787
$app->tpl->setVar("username_prefix", $global_config['shelluser_prefix']);

0 commit comments

Comments
 (0)