diff --git a/web/add/db/index.php b/web/add/db/index.php index 6d3d6dbcc..3d9826950 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -1,6 +1,6 @@ ', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } else { + $data = json_decode(implode('', $output), true); + unset($output); + $v_username = $user; + $v_database = $_GET['database']; + $v_dbuser = $data[$v_database]['DBUSER']; + $v_password = "••••••••"; + $v_host = $data[$v_database]['HOST']; + $v_type = $data[$v_database]['TYPE']; + $v_charset = $data[$v_database]['CHARSET']; + $v_date = $data[$v_database]['DATE']; + $v_time = $data[$v_database]['TIME']; + $v_suspended = $data[$v_database]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; + } + + // Action + if (!empty($_POST['save'])) { + $v_username = $user; + // Change password + if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { + $v_password = escapeshellarg($_POST['v_password']); + exec (VESTA_CMD."v_change_database_password ".$v_username." ".$v_database." ".$v_password, $output, $return_var); + if ($return_var != 0) { + $error = implode('', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + $v_password = "••••••••"; + unset($output); + } + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = "OK: changes has been saved."; + } + } + } + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_db.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/dns/index.php b/web/edit/dns/index.php index 9f5ad65ce..294a5ba94 100644 --- a/web/edit/dns/index.php +++ b/web/edit/dns/index.php @@ -1,6 +1,6 @@ + function elementHideShow(elementToHideOrShow) { + var el = document.getElementById(elementToHideOrShow); + if (el.style.display == "block") { + el.style.display = "none"; + } else { + el.style.display = "block"; + } + } + + function randomString() { + var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; + var string_length = 10; + var randomstring = ''; + for (var i=0; i + + + + + + + + + + + + + + + + + + Prefix "" will be automaticaly added to database name and database user + Database + disabled> + Username + disabled> + Password generate + > + Type + disabled> + Host + disabled> + Charset + disabled> + + + + + + + + diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index 70afb79e4..876006583 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -5,18 +5,57 @@ foreach ($data as $key => $value) { ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; - $spnd_action = 'ususpend' ; + $spnd_action = 'unsuspend' ; } else { $status = 'active'; $spnd_action = 'suspend' ; } - if (empty($data[$key]['CATCHALL'])) { - $data[$key]['CATCHALL'] = 'null'; - } + if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$_SERVER["HTTP_HOST"]."/phpMyAdmin/"; + if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$_SERVER["HTTP_HOST"]."/phpPgAdmin/"; ?> + + @@ -28,10 +67,22 @@ foreach ($data as $key => $value) { - open web admin - edit - - delete + open web admin + edit + + + "> + " title="Confirmation"> + Are you sure you want to database? + + + + + delete + + Are you sure you want to delete database? + + diff --git a/web/templates/admin/menu_edit_db.html b/web/templates/admin/menu_edit_db.html new file mode 100644 index 000000000..9d6b3d7fc --- /dev/null +++ b/web/templates/admin/menu_edit_db.html @@ -0,0 +1,15 @@ + + + Editing Database + → ".$_SESSION['error_msg'].""; + } else { + if (!empty($_SESSION['ok_msg'])) { + echo " → ".$_SESSION['ok_msg'].""; + } + } + ?> + + + diff --git a/web/unsuspend/db/index.php b/web/unsuspend/db/index.php new file mode 100644 index 000000000..738dd2308 --- /dev/null +++ b/web/unsuspend/db/index.php @@ -0,0 +1,17 @@ +
Are you sure you want to database?
Are you sure you want to delete database?