mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Fix /edit/server/ always says database unsupported
This commit changes interface of bin/v-list-database-hosts
This commit is contained in:
parent
656d34ed0b
commit
e0f695e493
5 changed files with 83 additions and 89 deletions
|
@ -120,12 +120,13 @@ $v_db_email = $panel[$user]['CONTACT'];
|
|||
$db_types = split(",",$_SESSION['DB_SYSTEM']);
|
||||
|
||||
// List available database servers
|
||||
$db_hosts = array();
|
||||
exec (VESTA_CMD."v-list-database-hosts 'json'", $output, $return_var);
|
||||
$db_hosts_tmp = json_decode(implode('', $output), true);
|
||||
$db_hosts = array_merge($db_hosts, $db_hosts_tmp);
|
||||
unset($db_hosts_tmp);
|
||||
exec (VESTA_CMD."v-list-database-hosts json", $output, $return_var);
|
||||
$db_hosts_tmp1 = json_decode(implode('', $output), true);
|
||||
$db_hosts_tmp2 = array_map(function($host){return $host['HOST'];}, $db_hosts_tmp1);
|
||||
$db_hosts = array_values(array_unique($db_hosts_tmp2));
|
||||
unset($output);
|
||||
unset($db_hosts_tmp1);
|
||||
unset($db_hosts_tmp2);
|
||||
|
||||
// Display body
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
|
||||
|
@ -136,4 +137,3 @@ unset($_SESSION['ok_msg']);
|
|||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue