1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 00:28:34 +02:00

Add helper function

This commit is contained in:
Jakub Vrana
2025-03-08 06:13:18 +01:00
parent 4b71549ca0
commit d35c896b92
13 changed files with 62 additions and 87 deletions

View File

@@ -56,7 +56,7 @@ if ($_POST && !$error) {
$pass = $_POST["pass"];
if ($pass != '' && !$_POST["hashed"] && !min_version(8)) {
// compute hash in a separate query so that plain text password is not saved to history
$pass = $connection->result("SELECT PASSWORD(" . q($pass) . ")");
$pass = get_val("SELECT PASSWORD(" . q($pass) . ")");
$error = !$pass;
}
@@ -124,7 +124,7 @@ if ($_POST) {
$row = $_POST;
$grants = $new_grants;
} else {
$row = $_GET + array("host" => $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)")); // create user on the same domain by default
$row = $_GET + array("host" => get_val("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)")); // create user on the same domain by default
$row["pass"] = $old_pass;
if ($old_pass != "") {
$row["hashed"] = true;