fix adding mysql-server to customers without any prior assigned mysql-server, fixes #1123; fix issues with displaying set value if path-mode is 'dropdown'
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -516,7 +516,7 @@ class MysqlServer extends ApiCommand implements ResourceEntity
|
|||||||
`allowed_mysqlserver` = :am WHERE `customerid` = :cid
|
`allowed_mysqlserver` = :am WHERE `customerid` = :cid
|
||||||
");
|
");
|
||||||
while ($customer = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($customer = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$allowed_mysqls = json_decode(($customer['allowed_mysqlserver'] ?? '[]'), true);
|
$allowed_mysqls = json_decode(($customer['allowed_mysqlserver'] ?: '[]'), true);
|
||||||
if (!in_array($dbserver, $allowed_mysqls)) {
|
if (!in_array($dbserver, $allowed_mysqls)) {
|
||||||
$allowed_mysqls[] = $dbserver;
|
$allowed_mysqls[] = $dbserver;
|
||||||
$allowed_mysqls = json_encode($allowed_mysqls);
|
$allowed_mysqls = json_encode($allowed_mysqls);
|
||||||
|
|||||||
@@ -447,7 +447,8 @@ class FileDir
|
|||||||
$field = [
|
$field = [
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $_field,
|
'select_var' => $_field,
|
||||||
'selected' => $value
|
'selected' => $value,
|
||||||
|
'value' => $value
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$field = [
|
$field = [
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ return [
|
|||||||
'label' => lng('panel.path'),
|
'label' => lng('panel.path'),
|
||||||
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescriptionSubdomain').(Settings::Get('system.documentroot_use_default_value') == 1 ? lng('panel.pathDescriptionEx') : '') : null),
|
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? lng('panel.pathDescriptionSubdomain').(Settings::Get('system.documentroot_use_default_value') == 1 ? lng('panel.pathDescriptionEx') : '') : null),
|
||||||
'type' => $pathSelect['type'],
|
'type' => $pathSelect['type'],
|
||||||
'select_var' => $pathSelect['value'],
|
'select_var' => $pathSelect['select_var'] ?? '',
|
||||||
'selected' => $pathSelect['value'],
|
'selected' => $pathSelect['value'],
|
||||||
'value' => $pathSelect['value'],
|
'value' => $pathSelect['value'],
|
||||||
'note' => $pathSelect['note'] ?? '',
|
'note' => $pathSelect['note'] ?? '',
|
||||||
|
|||||||
Reference in New Issue
Block a user