update dev-environment to use more recent versions, requries php-7.3 now (dev-only)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -340,11 +340,12 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
'login' => $loginname
|
||||
), true, true);
|
||||
|
||||
$mysql_maxlen = \Froxlor\Database\Database::getSqlUsernameLength() - strlen(Settings::Get('customer.mysqlprefix'));
|
||||
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
|
||||
} elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), 14 - strlen(Settings::Get('customer.mysqlprefix')))) {
|
||||
if (strlen($loginname) > 14 - strlen(Settings::Get('customer.mysqlprefix'))) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong2', 14 - strlen(Settings::Get('customer.mysqlprefix')), true);
|
||||
} elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), $mysql_maxlen)) {
|
||||
if (strlen($loginname) > $mysql_maxlen) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong2', $mysql_maxlen, true);
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ class Database
|
||||
// MySQL user names can be up to 32 characters long (16 characters before MySQL 5.7.8).
|
||||
$mysql_max = 32;
|
||||
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.8', '<')) {
|
||||
$mysql_max -= 16;
|
||||
$mysql_max = 16;
|
||||
}
|
||||
return $mysql_max;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ class Check
|
||||
}
|
||||
|
||||
$returnvalue = array();
|
||||
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
||||
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), \Froxlor\Database\Database::getSqlUsernameLength() - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
||||
$returnvalue = array(
|
||||
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user