// load the appropriate auth plugin
$userauth = get_auth_plugin($user->auth);
if ($userauth->can_change_password()){
- if ($userauth->user_update_password($user, $data->newpassword1)) {
+ if ($userauth->user_update_password($user->username, $data->newpassword1)) {
// hash the $user->password field (without local db update)
- update_internal_user_password($user, $frm->newpassword1, false);
+ update_internal_user_password($user, $data->newpassword1, false);
} else {
error('Could not set the new password');
}
// if url defined then add that to the message (with a standard message)
if (method_exists($userauth, 'change_password_url') and $userauth->change_password_url()) {
$strextmessage .= $strpasswordextlink . '<br /><br />';
- $txt->extmessage .= '<a href="' . $userauth->change_password_url() . '">' . $userauth->change_password_url() . '</a>';
+ $strextmessage .= '<a href="' . $userauth->change_password_url() . '">' . $userauth->change_password_url() . '</a>';
}
// if nothing to display, just do message that we can't help
if (empty($strextmessage)) {
}
-echo $strforgotteninstruct;
-
+if(!$mform->data_submitted()) {
+ echo $strforgotteninstruct;
+ $mform->display();
+}
print_simple_box_end();
-$mform->display();
-
print_footer();
-?>
+?>
\ No newline at end of file