fix keep-current-password when editing mysql-server
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -131,7 +131,7 @@ class MysqlServer extends ApiCommand implements ResourceEntity
|
|||||||
require Froxlor::getInstallDir() . "/lib/userdata.inc.php";
|
require Froxlor::getInstallDir() . "/lib/userdata.inc.php";
|
||||||
|
|
||||||
// le format
|
// le format
|
||||||
if (isset($sql['root_user']) && isset($sql['root_password']) &&!is_array($sql_root)) {
|
if (isset($sql['root_user']) && isset($sql['root_password']) && !is_array($sql_root)) {
|
||||||
$sql_root = array(
|
$sql_root = array(
|
||||||
0 => array(
|
0 => array(
|
||||||
'caption' => 'Default',
|
'caption' => 'Default',
|
||||||
@@ -377,7 +377,7 @@ class MysqlServer extends ApiCommand implements ResourceEntity
|
|||||||
$mysql_ca = $this->getParam('mysql_ca', true, $result['ssl']['caFile'] ?? '');
|
$mysql_ca = $this->getParam('mysql_ca', true, $result['ssl']['caFile'] ?? '');
|
||||||
$mysql_verifycert = $this->getBoolParam('mysql_verifycert', true, $result['ssl']['verifyServerCertificate'] ?? 0);
|
$mysql_verifycert = $this->getBoolParam('mysql_verifycert', true, $result['ssl']['verifyServerCertificate'] ?? 0);
|
||||||
$privileged_user = $this->getParam('privileged_user', true, $result['user']);
|
$privileged_user = $this->getParam('privileged_user', true, $result['user']);
|
||||||
$privileged_password = $this->getParam('privileged_password', true, $result['password']);
|
$privileged_password = $this->getParam('privileged_password', true, '');
|
||||||
$description = $this->getParam('description', true, $result['caption']);
|
$description = $this->getParam('description', true, $result['caption']);
|
||||||
$allow_all_customers = $this->getParam('allow_all_customers', true, 0);
|
$allow_all_customers = $this->getParam('allow_all_customers', true, 0);
|
||||||
$test_connection = $this->getParam('test_connection', true, 1);
|
$test_connection = $this->getParam('test_connection', true, 1);
|
||||||
@@ -397,6 +397,11 @@ class MysqlServer extends ApiCommand implements ResourceEntity
|
|||||||
$privileged_password = Validate::validate($privileged_password, 'password', '', '', [], true);
|
$privileged_password = Validate::validate($privileged_password, 'password', '', '', [], true);
|
||||||
$description = Validate::validate(trim($description), 'description', Validate::REGEX_DESC_TEXT, '', [], true);
|
$description = Validate::validate(trim($description), 'description', Validate::REGEX_DESC_TEXT, '', [], true);
|
||||||
|
|
||||||
|
// keep old password?
|
||||||
|
if (empty($privileged_password)) {
|
||||||
|
$privileged_password = $result['password'];
|
||||||
|
}
|
||||||
|
|
||||||
if ($mysql_host != $result['host']) {
|
if ($mysql_host != $result['host']) {
|
||||||
// check whether the server is in use by any customer
|
// check whether the server is in use by any customer
|
||||||
$result_ms = $this->databasesOnServer(true, $dbserver);
|
$result_ms = $this->databasesOnServer(true, $dbserver);
|
||||||
|
|||||||
Reference in New Issue
Block a user