Commit 01d133cd authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#1328 - edit ftp/ssh user: mangled usernames with duplicate prefix

parent 28eadb79
...@@ -81,7 +81,7 @@ class page_action extends tform_actions { ...@@ -81,7 +81,7 @@ class page_action extends tform_actions {
if ($this->dataRecord['username'] != ""){ if ($this->dataRecord['username'] != ""){
/* REMOVE the restriction */ /* REMOVE the restriction */
$app->tpl->setVar("username", str_replace($ftpuser_prefix , '', $this->dataRecord['username'])); $app->tpl->setVar("username", preg_replace('/'.$ftpuser_prefix.'/' , '', $this->dataRecord['username'], 1));
} }
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
$app->tpl->setVar("username_prefix", $global_config['ftpuser_prefix']); $app->tpl->setVar("username_prefix", $global_config['ftpuser_prefix']);
......
...@@ -81,7 +81,7 @@ class page_action extends tform_actions { ...@@ -81,7 +81,7 @@ class page_action extends tform_actions {
if ($this->dataRecord['username'] != ""){ if ($this->dataRecord['username'] != ""){
/* REMOVE the restriction */ /* REMOVE the restriction */
$app->tpl->setVar("username", str_replace($shelluser_prefix , '', $this->dataRecord['username'])); $app->tpl->setVar("username", preg_replace('/'.$shelluser_prefix.'/', '', $this->dataRecord['username'], 1));
} }
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
$app->tpl->setVar("username_prefix", $global_config['shelluser_prefix']); $app->tpl->setVar("username_prefix", $global_config['shelluser_prefix']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment