From b59466135690b1df858502c0d17c5aba14e0c962 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 11 Nov 2007 19:05:42 +0000 Subject: [PATCH] - do not clear password on editing admins when no new password is entered Thanks for Benny Pedersen (xpunkt) to find out that this bug reappeared. https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1829564&group_id=191583 git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@206 a1433add-5e2c-0410-b055-b7f2511e0802 --- edit-admin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/edit-admin.php b/edit-admin.php index c8558c2d..dc9dd452 100644 --- a/edit-admin.php +++ b/edit-admin.php @@ -101,7 +101,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $sqlActive = db_get_boolean(False); } - $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive',password='$fPassword' WHERE username='$username'"); + $password_query = ''; + if ($fPassword != '') { # do not change password to empty one + $password_query = ", password='$fPassword'"; + } + $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); if ($fSadmin == "on") $fSadmin = 'ALL'; @@ -150,3 +154,6 @@ include ("templates/header.tpl"); include ("templates/menu.tpl"); include ("templates/admin_edit-admin.tpl"); include ("templates/footer.tpl"); + +/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +?>