fix update of domain as admin if domain is a std-subdomain; fix update of mysql-entry; add CustomerBackups-ApiCommand

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-03-19 10:45:12 +01:00
parent dfcb7160cb
commit 715e5f7a64
4 changed files with 159 additions and 63 deletions

View File

@@ -305,17 +305,7 @@ class Mysqls extends ApiCommand implements ResourceEntity
// validation
$password = validate($password, 'password', '', '', array(), true);
$databasedescription = validate(trim($databasedescription), 'description', '', '', array(), true);
// validate whether the dbserver exists
$dbserver = validate($dbserver, html_entity_decode($this->lng['mysql']['mysql_server']), '', '', 0, true);
Database::needRoot(true, $dbserver);
Database::needSqlData();
$sql_root = Database::getSqlData();
Database::needRoot(false);
if (! isset($sql_root) || ! is_array($sql_root)) {
throw new ErrorException("Database server with index #" . $dbserver . " is unknown", 404);
}
// get needed customer info to reduce the mysql-usage-counter by one
$customer = $this->getCustomerData();