Forgotten password page does not check secret MDL-7755

This commit is contained in:
skodak
2006-12-01 09:13:06 +00:00
parent 59fd781a66
commit 14bac768f3
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -570,6 +570,7 @@ $string['forcepasswordchangenotice'] = 'You must change your password to proceed
$string['forcetheme'] = 'Force theme';
$string['forgotaccount'] = 'Lost password?';
$string['forgotten'] = 'Forgotten your username or password?';
$string['forgotteninvalidurl'] = 'Invalid password reset URL';
$string['format'] = 'Format';
$string['formathtml'] = 'HTML format';
$string['formatlams'] = 'LAMS course format';
+4 -1
View File
@@ -39,6 +39,7 @@ $txt->senddetails = get_string('senddetails');
$txt->username = get_string('username');
$txt->usernameemailmatch = get_string('usernameemailmatch');
$txt->usernamenotfound = get_string('usernamenotfound');
$txt->invalidurl = get_string('forgotteninvalidurl');
$sesskey = sesskey();
$errors = array();
@@ -179,7 +180,7 @@ if (!empty($param->p) and !empty($param->s)) {
$user = get_complete_user_data('username',$param->s);
// make sure that url relates to a valid user
if (!empty($user)) {
if (!empty($user) and $user->secret == $param->p) {
// check this isn't guest user
if (isguest( $user->id )) {
error('You cannot change the guest password');
@@ -198,6 +199,8 @@ if (!empty($param->p) and !empty($param->s)) {
$a->email = $user->email;
$a->link = $changepasswordurl;
$txt->emailpasswordsent = get_string( 'emailpasswordsent', '', $a );
} else {
$errors[] = $txt->invalidurl;
}
}