pass mysql_server after adding to Mysqls.get command, do not validate in Mysqls.get if left empty on purpose
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -202,7 +202,8 @@ class Mysqls extends ApiCommand implements ResourceEntity
|
|||||||
$this->logger()->logAction($this->isAdmin() ? FroxlorLogger::ADM_ACTION : FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] added mysql-database '" . $username . "'");
|
$this->logger()->logAction($this->isAdmin() ? FroxlorLogger::ADM_ACTION : FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] added mysql-database '" . $username . "'");
|
||||||
|
|
||||||
$result = $this->apiCall('Mysqls.get', [
|
$result = $this->apiCall('Mysqls.get', [
|
||||||
'dbname' => $username
|
'dbname' => $username,
|
||||||
|
'mysql_server' => $dbserver
|
||||||
]);
|
]);
|
||||||
return $this->response($result);
|
return $this->response($result);
|
||||||
}
|
}
|
||||||
@@ -230,7 +231,9 @@ class Mysqls extends ApiCommand implements ResourceEntity
|
|||||||
$dbname = $this->getParam('dbname', $dn_optional, '');
|
$dbname = $this->getParam('dbname', $dn_optional, '');
|
||||||
$dbserver = $this->getParam('mysql_server', true, -1);
|
$dbserver = $this->getParam('mysql_server', true, -1);
|
||||||
|
|
||||||
$dbserver = Validate::validate($dbserver, html_entity_decode(lng('mysql.mysql_server')), '/^[0-9]+$/', '', 0, true);
|
if ($dbserver != -1) {
|
||||||
|
$dbserver = Validate::validate($dbserver, html_entity_decode(lng('mysql.mysql_server')), '/^[0-9]+$/', '', 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isAdmin()) {
|
if ($this->isAdmin()) {
|
||||||
if ($this->getUserDetail('customers_see_all') != 1) {
|
if ($this->getUserDetail('customers_see_all') != 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user