moved change_password code to the auth class where it belongs

This commit is contained in:
seek3r 2001-01-04 20:29:28 +00:00
parent 534337b237
commit 75c26a23fe
4 changed files with 22 additions and 18 deletions

View File

@ -25,7 +25,7 @@
} }
function change_password($old_passwd, $new_passwd) { function change_password($old_passwd, $new_passwd) {
global $phpgw_info, $phpgw; global $phpgw_info, $phpgw;
return $old_passwd; return False;
} }
} }
?> ?>

View File

@ -54,7 +54,7 @@
} }
$encrypted_passwd = $phpgw->common->encrypt_password($new_passwd); $encrypted_passwd = $phpgw->common->encrypt_password($new_passwd);
$entry["userpassword"] = $encrypted_passwd $entry["userpassword"] = $encrypted_passwd;
$entry["phpgw_lastpasswd_change"] = time(); $entry["phpgw_lastpasswd_change"] = time();
$dn = $phpgw_info["user"]["account_dn"]; $dn = $phpgw_info["user"]["account_dn"];

View File

@ -41,7 +41,7 @@
} }
function change_password($old_passwd, $new_passwd) { function change_password($old_passwd, $new_passwd) {
global $phpgw_info, $phpgw; global $phpgw_info, $phpgw;
return $old_passwd; return False;
} }
} }
?> ?>

View File

@ -61,23 +61,27 @@
$phpgw->common->phpgw_footer(); $phpgw->common->phpgw_footer();
} else { } else {
if ($n_passwd != $n_passwd_2) if ($n_passwd != $n_passwd_2)
$error = lang("the two passwords are not the same"); $error = lang("the two passwords are not the same");
if (! $n_passwd) if (! $n_passwd)
$error = lang("you must enter a password"); $error = lang("you must enter a password");
if ($error) { if ($error) {
$phpgw->common->navbar(); $phpgw->common->navbar();
echo "<p><br>$error</p>"; echo "<p><br>$error</p>";
$phpgw->common->phpgw_exit(); $phpgw->common->phpgw_exit();
} }
$o_passwd = $phpgw_info["user"]["passwd"]; $o_passwd = $phpgw_info["user"]["passwd"];
$phpgw_info["user"]["passwd"] = $phpgw->auth->change_password($o_passwd, $n_passwd); $passwd_changed = $phpgw->auth->change_password($o_passwd, $n_passwd);
if (!$passwd_changed){
$phpgw->accounts->sync(); // This need to be changed to show a different message based on the result
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/"));
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=18")); }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"));
}
} }
?> ?>