and more and more and more

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 17:00:54 +01:00
parent a819d81ef2
commit b0e11f5708
9 changed files with 14 additions and 14 deletions

View File

@@ -91,7 +91,7 @@ if ($action == 'delete') {
$ip_list = array_map('trim', explode(",", $allowed_from)); $ip_list = array_map('trim', explode(",", $allowed_from));
$_check_list = $ip_list; $_check_list = $ip_list;
foreach ($_check_list as $idx => $ip) { foreach ($_check_list as $idx => $ip) {
if (validate_ip2($ip, true, 'invalidip', true, true) == false) { if (\Froxlor\Validate\Validate::validate_ip2($ip, true, 'invalidip', true, true) == false) {
unset($ip_list[$idx]); unset($ip_list[$idx]);
} }
} }

View File

@@ -237,9 +237,9 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
} // Accounts which match systemaccounts are not allowed, filtering them } // Accounts which match systemaccounts are not allowed, filtering them
elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) { elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) {
\Froxlor\UI\Response::standard_error('loginnameissystemaccount', Settings::Get('customer.accountprefix'), true); \Froxlor\UI\Response::standard_error('loginnameissystemaccount', Settings::Get('customer.accountprefix'), true);
} elseif (! validateUsername($loginname)) { } elseif (! \Froxlor\Validate\Validate::validateUsername($loginname)) {
\Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true); \Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true);
} elseif (! validateEmail($email)) { } elseif (! \Froxlor\Validate\Validate::validateEmail($email)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $email, true); \Froxlor\UI\Response::standard_error('emailiswrong', $email, true);
} else { } else {
@@ -504,7 +504,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$theme = Settings::Get('panel.default_theme'); $theme = Settings::Get('panel.default_theme');
} }
if (! validateEmail($email)) { if (! \Froxlor\Validate\Validate::validateEmail($email)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $email, true); \Froxlor\UI\Response::standard_error('emailiswrong', $email, true);
} else { } else {

View File

@@ -300,7 +300,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
\Froxlor\UI\Response::standard_error('youcantallocatemorethanyouhave', '', true); \Froxlor\UI\Response::standard_error('youcantallocatemorethanyouhave', '', true);
} }
if (! validateEmail($email)) { if (! \Froxlor\Validate\Validate::validateEmail($email)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $email, true); \Froxlor\UI\Response::standard_error('emailiswrong', $email, true);
} else { } else {
@@ -342,7 +342,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) { if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) {
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true); \Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
} elseif (! validateUsername($loginname, Settings::Get('panel.unix_names'), 14 - strlen(Settings::Get('customer.mysqlprefix')))) { } 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'))) { if (strlen($loginname) > 14 - strlen(Settings::Get('customer.mysqlprefix'))) {
\Froxlor\UI\Response::standard_error('loginnameiswrong2', 14 - strlen(Settings::Get('customer.mysqlprefix')), true); \Froxlor\UI\Response::standard_error('loginnameiswrong2', 14 - strlen(Settings::Get('customer.mysqlprefix')), true);
} else { } else {
@@ -934,7 +934,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'stringisempty', 'stringisempty',
'emailadd' 'emailadd'
), '', true); ), '', true);
} elseif (! validateEmail($email)) { } elseif (!\Froxlor\Validate\Validate::validateEmail($email)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $email, true); \Froxlor\UI\Response::standard_error('emailiswrong', $email, true);
} }
} }

View File

@@ -246,7 +246,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
), '', \Froxlor\Validate\Validate::validate($p_domain, 'domain'))); ), '', \Froxlor\Validate\Validate::validate($p_domain, 'domain')));
// Check whether domain validation is enabled and if, validate the domain // Check whether domain validation is enabled and if, validate the domain
if (Settings::Get('system.validate_domain') && ! validateDomain($domain)) { if (Settings::Get('system.validate_domain') && ! \Froxlor\Validate\Validate::validateDomain($domain)) {
\Froxlor\UI\Response::standard_error(array( \Froxlor\UI\Response::standard_error(array(
'stringiswrong', 'stringiswrong',
'mydomain' 'mydomain'

View File

@@ -100,7 +100,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
// alternative email address to send info to // alternative email address to send info to
if (Settings::Get('panel.sendalternativemail') == 1) { if (Settings::Get('panel.sendalternativemail') == 1) {
$alternative_email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($alternative_email, 'alternative_email', '', '', array(), true)); $alternative_email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($alternative_email, 'alternative_email', '', '', array(), true));
if (! validateEmail($alternative_email)) { if (! \Froxlor\Validate\Validate::validateEmail($alternative_email)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $alternative_email, true); \Froxlor\UI\Response::standard_error('emailiswrong', $alternative_email, true);
} }
} else { } else {

View File

@@ -70,7 +70,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
// prepare destination // prepare destination
$destination = trim($destination); $destination = trim($destination);
if (! validateEmail($destination)) { if (! \Froxlor\Validate\Validate::validateEmail($destination)) {
\Froxlor\UI\Response::standard_error('destinationiswrong', $destination, true); \Froxlor\UI\Response::standard_error('destinationiswrong', $destination, true);
} elseif ($destination == $result['email']) { } elseif ($destination == $result['email']) {
\Froxlor\UI\Response::standard_error('destinationalreadyexistasmail', $destination, true); \Froxlor\UI\Response::standard_error('destinationalreadyexistasmail', $destination, true);

View File

@@ -86,7 +86,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$email_full = $email_part . '@' . $domain; $email_full = $email_part . '@' . $domain;
// validate it // validate it
if (! validateEmail($email_full)) { if (! \Froxlor\Validate\Validate::validateEmail($email_full)) {
\Froxlor\UI\Response::standard_error('emailiswrong', $email_full, true); \Froxlor\UI\Response::standard_error('emailiswrong', $email_full, true);
} }

View File

@@ -127,7 +127,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
{ {
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$ip = validate_ip2($this->getParam('ip'), false, 'invalidip', false, false, false, true); $ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip'), false, 'invalidip', false, false, false, true);
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array( $port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
'stringisempty', 'stringisempty',
'myport' 'myport'
@@ -302,7 +302,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'id' => $id 'id' => $id
)); ));
$ip = validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, false, false, true); $ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, false, false, true);
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array( $port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
'stringisempty', 'stringisempty',
'myport' 'myport'

View File

@@ -186,7 +186,7 @@ class Check
} }
$returnvalue = array(); $returnvalue = array();
if (validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) { if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
$returnvalue = array( $returnvalue = array(
FORMFIELDS_PLAUSIBILITY_CHECK_OK FORMFIELDS_PLAUSIBILITY_CHECK_OK
); );