diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index 044933db..2b40a799 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -286,7 +286,9 @@ class Admins extends ApiCommand implements ResourceEntity Response::standardError('loginnameexists', $loginname, true); } elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) { // Accounts which match systemaccounts are not allowed, filtering them - Response::standardError('loginnameissystemaccount', Settings::Get('customer.accountprefix'), true); + Response::standardError('loginnameisusingprefix', Settings::Get('customer.accountprefix'), true); + } elseif (function_exists('posix_getpwnam') && !in_array("posix_getpwnam", explode(",", ini_get('disable_functions'))) && posix_getpwnam($loginname)) { + Response::standardError('loginnameissystemaccount', $loginname, true); } elseif (!Validate::validateUsername($loginname)) { Response::standardError('loginnameiswrong', $loginname, true); } elseif (!Validate::validateEmail($email)) { diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index da0f1a31..0eeb8ffd 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -429,7 +429,7 @@ class Customers extends ApiCommand implements ResourceEntity // Additional filtering for Bug #962 if (function_exists('posix_getpwnam') && !in_array("posix_getpwnam", explode(",", ini_get('disable_functions'))) && posix_getpwnam($loginname)) { - Response::standardError('loginnameissystemaccount', Settings::Get('customer.accountprefix'), true); + Response::standardError('loginnameissystemaccount', $loginname, true); } } else { $accountnumber = intval(Settings::Get('system.lastaccountnumber')) + 1; diff --git a/tests/Admins/AdminsTest.php b/tests/Admins/AdminsTest.php index 6c2a8492..ff83199b 100644 --- a/tests/Admins/AdminsTest.php +++ b/tests/Admins/AdminsTest.php @@ -86,7 +86,7 @@ class AdminsTest extends TestCase 'name' => 'Testreseller' ]; - $this->expectExceptionMessage('You cannot create accounts which are similar to system accounts (as for example begin with "web"). Please enter another account name.'); + $this->expectExceptionMessage('You cannot create accounts that begin with "web", as this prefix is set to be used for the automatic account-naming. Please enter another account name.'); Admins::getLocal($admin_userdata, $data)->add(); } diff --git a/tests/Customers/CustomersTest.php b/tests/Customers/CustomersTest.php index 401049c5..214a453d 100644 --- a/tests/Customers/CustomersTest.php +++ b/tests/Customers/CustomersTest.php @@ -491,7 +491,7 @@ class CustomersTest extends TestCase ) ]; - $this->expectExceptionMessage('You cannot create accounts which are similar to system accounts (as for example begin with "web"). Please enter another account name.'); + $this->expectExceptionMessage('You cannot create accounts that begin with "web", as this prefix is set to be used for the automatic account-naming. Please enter another account name.'); Customers::getLocal($admin_userdata, $data)->add(); }