fix allowed-phpconfigs check in SubDomains.add() and SubDomains.update()
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -262,14 +262,14 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
$phpsid_result['phpsettingid'] = intval($phpsettingid);
|
||||
}
|
||||
|
||||
$allowed_phpconfigs = $this->getUserDetail('allowed_phpconfigs');
|
||||
$allowed_phpconfigs = $customer['allowed_phpconfigs'];
|
||||
if (! empty($allowed_phpconfigs)) {
|
||||
$allowed_phpconfigs = json_decode($allowed_phpconfigs, true);
|
||||
} else {
|
||||
$allowed_phpconfigs = [];
|
||||
}
|
||||
if (! in_array($phpsid_result['phpsettingid'], $allowed_phpconfigs)) {
|
||||
\Froxlor\UI\Response::dynamic_error('Trying to use php-config which is not assigned to customer');
|
||||
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
|
||||
}
|
||||
|
||||
// actually insert domain
|
||||
@@ -626,7 +626,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
|
||||
// We can't enable let's encrypt for wildcard-domains
|
||||
if ($iswildcarddomain == '1' && $letsencrypt == '1') {
|
||||
\Froxlor\UI\Response::standard_error('nowildcardwithletsencrypt');
|
||||
\Froxlor\UI\Response::standard_error('nowildcardwithletsencrypt', '', true);
|
||||
}
|
||||
|
||||
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||
@@ -655,7 +655,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
||||
$allowed_phpconfigs = [];
|
||||
}
|
||||
if (! in_array($phpsettingid, $allowed_phpconfigs)) {
|
||||
\Froxlor\UI\Response::dynamic_error('Trying to use php-config which is not assigned to customer');
|
||||
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
|
||||
}
|
||||
|
||||
// handle redirect
|
||||
|
||||
@@ -60,7 +60,7 @@ class DbManagerMySQL
|
||||
*/
|
||||
public function createDatabase($dbname = null)
|
||||
{
|
||||
Database::query("CREATE DATABASE `" . Database::quote($dbname) . "`");
|
||||
Database::query("CREATE DATABASE `" . $dbname . "`");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user