From 721de834b5bc12826beab7b23c744907051c32d6 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Mon, 8 Mar 2010 09:01:43 +0100 Subject: [PATCH] Encode password with new users' login --- ajax/ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ajax/ajax.php b/ajax/ajax.php index 6597a76..213160a 100644 --- a/ajax/ajax.php +++ b/ajax/ajax.php @@ -108,7 +108,9 @@ function save($mask) $update[] = sprintf("%s=%s", $field, format_decimal($_POST[$field])); } elseif ($info['type'] == 'passwd') { if (!empty($_POST[$field])) - $update[] = sprintf("%s='%s'", $field, pg_escape_string(passwd($_SESSION['sys']['login'],$_POST[$field]))); + $update[] = sprintf("%s='%s'", $field, + pg_escape_string(passwd(empty($_POST['login'])?$_SESSION['sys']['login']:$_POST['login'], + $_POST[$field]))); } else { if (empty($_POST[$field]) && $info['null'] === true) $update[] = sprintf("%s=NULL", $field); -- 2.20.1