diff --git a/phpgwapi/inc/phpgw_auth_http.inc.php b/phpgwapi/inc/phpgw_auth_http.inc.php index 20c2c3324d..88122c9dab 100644 --- a/phpgwapi/inc/phpgw_auth_http.inc.php +++ b/phpgwapi/inc/phpgw_auth_http.inc.php @@ -25,7 +25,7 @@ } function change_password($old_passwd, $new_passwd) { global $phpgw_info, $phpgw; - return $old_passwd; + return False; } } ?> \ No newline at end of file diff --git a/phpgwapi/inc/phpgw_auth_ldap.inc.php b/phpgwapi/inc/phpgw_auth_ldap.inc.php index d8abe0048f..807ae09dec 100644 --- a/phpgwapi/inc/phpgw_auth_ldap.inc.php +++ b/phpgwapi/inc/phpgw_auth_ldap.inc.php @@ -54,7 +54,7 @@ } $encrypted_passwd = $phpgw->common->encrypt_password($new_passwd); - $entry["userpassword"] = $encrypted_passwd + $entry["userpassword"] = $encrypted_passwd; $entry["phpgw_lastpasswd_change"] = time(); $dn = $phpgw_info["user"]["account_dn"]; diff --git a/phpgwapi/inc/phpgw_auth_mail.inc.php b/phpgwapi/inc/phpgw_auth_mail.inc.php index 88f9922427..56b731b9b8 100644 --- a/phpgwapi/inc/phpgw_auth_mail.inc.php +++ b/phpgwapi/inc/phpgw_auth_mail.inc.php @@ -41,7 +41,7 @@ } function change_password($old_passwd, $new_passwd) { global $phpgw_info, $phpgw; - return $old_passwd; + return False; } } ?> \ No newline at end of file diff --git a/preferences/changepassword.php b/preferences/changepassword.php index c8067524b2..b079e6e337 100755 --- a/preferences/changepassword.php +++ b/preferences/changepassword.php @@ -61,23 +61,27 @@ $phpgw->common->phpgw_footer(); } else { - if ($n_passwd != $n_passwd_2) - $error = lang("the two passwords are not the same"); + if ($n_passwd != $n_passwd_2) + $error = lang("the two passwords are not the same"); - if (! $n_passwd) - $error = lang("you must enter a password"); + if (! $n_passwd) + $error = lang("you must enter a password"); - if ($error) { - $phpgw->common->navbar(); - echo "


$error

"; - $phpgw->common->phpgw_exit(); - } + if ($error) { + $phpgw->common->navbar(); + echo "


$error

"; + $phpgw->common->phpgw_exit(); + } - $o_passwd = $phpgw_info["user"]["passwd"]; - $phpgw_info["user"]["passwd"] = $phpgw->auth->change_password($o_passwd, $n_passwd); - - $phpgw->accounts->sync(); - - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=18")); + $o_passwd = $phpgw_info["user"]["passwd"]; + $passwd_changed = $phpgw->auth->change_password($o_passwd, $n_passwd); + if (!$passwd_changed){ + // This need to be changed to show a different message based on the result + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/")); + }else{ + $phpgw_info["user"]["passwd"] = $phpgw->auth->change_password($o_passwd, $n_passwd); + $phpgw->accounts->sync(); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=18")); + } } ?>