mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:49:10 +01:00
moved change_password code to the auth class where it belongs
This commit is contained in:
parent
534337b237
commit
75c26a23fe
@ -25,7 +25,7 @@
|
||||
}
|
||||
function change_password($old_passwd, $new_passwd) {
|
||||
global $phpgw_info, $phpgw;
|
||||
return $old_passwd;
|
||||
return False;
|
||||
}
|
||||
}
|
||||
?>
|
@ -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"];
|
||||
|
@ -41,7 +41,7 @@
|
||||
}
|
||||
function change_password($old_passwd, $new_passwd) {
|
||||
global $phpgw_info, $phpgw;
|
||||
return $old_passwd;
|
||||
return False;
|
||||
}
|
||||
}
|
||||
?>
|
@ -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 "<p><br>$error</p>";
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
if ($error) {
|
||||
$phpgw->common->navbar();
|
||||
echo "<p><br>$error</p>";
|
||||
$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"));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user