From fbf40f18abadd0fb515a9d27a12a991f50756329 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sun, 7 Jan 2001 03:40:38 +0000 Subject: [PATCH] fix for changing passwords --- admin/inc/accounts_ldap.inc.php | 11 ++++++++--- admin/inc/accounts_sql.inc.php | 7 +++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/admin/inc/accounts_ldap.inc.php b/admin/inc/accounts_ldap.inc.php index 260b59f722..43369c81ef 100644 --- a/admin/inc/accounts_ldap.inc.php +++ b/admin/inc/accounts_ldap.inc.php @@ -233,11 +233,16 @@ } if ($account_info["passwd"]) { - $entry["userpassword"] = $phpgw->common->encrypt_password($n_passwd); +// $entry["userpassword"] = $phpgw->common->encrypt_password($n_passwd); + $entry["userpassword"] = $phpgw->common->encrypt_password($account_info["passwd"]); + + if ($account_info["account_id"] == $phpgw_info["user"]["account_id"]) { + $phpgw_info["user"]["passwd"] = $phpgw->common->encrypt($account_info["passwd"]; + } // Update the sessions table. (The user might be logged in) - $phpgw->db->query("update sessions set session_pwd='" . $phpgw->common->encrypt($n_passwd) . "' " - . "where session_lid='$lid'",__LINE__,__FILE__); +// $phpgw->db->query("update phpgw_sessions set session_pwd='" . $phpgw->common->encrypt($n_passwd) . "' " +// . "where session_lid='$lid'",__LINE__,__FILE__); } while ($permission = each($account_info["permissions"])) { diff --git a/admin/inc/accounts_sql.inc.php b/admin/inc/accounts_sql.inc.php index 44eafc891c..63d06979c4 100755 --- a/admin/inc/accounts_sql.inc.php +++ b/admin/inc/accounts_sql.inc.php @@ -120,8 +120,11 @@ $phpgw->db->query("update accounts set account_pwd='" . md5($account_info["passwd"]) . "', " . "account_lastpwd_change='" . time() . "' where account_lid='" . $account_info["loginid"] . "'"); - $phpgw->db->query("update phpgw_sessions set session_pwd='" . addslashes($account_info["passwd"]) - . "' where session_lid='" . $account_info["loginid"] . "'"); + if ($account_info["account_id"] == $phpgw_info["user"]["account_id"]) { + $phpgw_info["user"]["passwd"] = $phpgw->common->encrypt($account_info["passwd"]; + } +// $phpgw->db->query("update phpgw_sessions set session_pwd='" . addslashes($account_info["passwd"]) +// . "' where session_lid='" . $account_info["loginid"] . "'"); } while ($permission = each($account_info["permissions"])) {