$string['cannotfindlang'] = 'Cannot find \"$a\" language pack!';
$string['cannotfindsite'] = 'Cannot find site-level course';
$string['cannotfindteacher'] = 'Cannot find teacher.';
+$string['cannotfinduser'] = 'Cannot find user named \"$a\"';
$string['cannotimportgrade'] = 'Grade import error';
$string['cannotimportformat'] = 'Sorry, importing this format is not yet implemented!';
$string['cannotnetgeo'] = 'Can not connect to NetGeo server at http://netgeo.caida.org, please check proxy settings or better install MaxMind GeoLite City data file.';
$string['cannotgetdata'] = 'Cannot get data';
$string['cannotgradeuser'] = 'Can not grade this user';
$string['cannothaveparentcate'] = 'Course category can not have parent!';
+$string['cannotmailconfirm'] = 'error sending password change confirmation email';
$string['cannotmapfield'] = 'mapping collision detected, 2 fields maps to the same grade item $a';
$string['cannotmarktopic'] = 'Could not mark that topic for this course';
$string['cannotmoverolewithid'] = 'Cannot move role with ID $a';
$string['cannotreadfile'] = 'Can not read file';
$string['cannotremovefrommeta'] = 'Could not remove the selected course from this meta course!';
$string['cannotrestore'] = 'An error has occurred and the restore could not be completed!';
+$string['cannotresetguestpwd'] = 'You cannot reset the guest password';
+$string['cannotresetmail'] = 'Error resetting password and mailing you';
$string['cannotsaveblock'] = 'Error saving block configuration';
$string['cannotsavefile'] = 'Cannot save the file \"$a\".';
$string['cannotinitpage'] = 'Cannot quickly initialize page, course id: $a';
$string['cannotupdateprofile'] = 'Error updating user record';
$string['cannotupdatecustomprofile'] = 'Error updating user custom record';
$stirng['cannotupdaterss'] = 'Cannot update rss';
+$string['cannotupdatesecret'] = 'Error resetting user secret string';
$string['cannotupdatesummary'] = 'Could not update the summary!';
$string['cannotupdatesubcate'] = 'Could not update a child category!';
$string['cannotupdatesubcourse'] = 'Could not update a child course!';
$string['cannotrestoreadminorcreator'] = 'You need to be a creator or admin user to restore into new course!';
$string['cannotrestoreadminoredit'] = 'You need to be a edit teacher or admin user to restore into selected course!';
$string['cannotusepage'] = 'Only teacher and administrator can use this page.';
+$string['cannotusepage2'] = 'Sorry, you may not use this page.';
$string['cannotviewprofile'] = 'You can not view the profile of this user.';
$string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.';
$string['cantunenrollinthisrole'] = 'You can not unenrol from this course while you are in your current role.';
$string['invalidcourseid'] = 'You are trying to use an invalid course ID: ($a)';
$string['invalidcourselevel'] = 'Incorrect context level';
$string['invalidcoursemodule'] = 'Invalid course module ID';
+$string['invalidconfirmdata'] = 'Invalid confirmation data';
$string['invalidcontext'] = 'Invalid context';
$string['invalidcomment'] = 'Comment is incorrect';
$string['invaliddata'] = 'Data submitted is invalid.';
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
if (!$course = $DB->get_record('course', array('id'=>$id))) {
- print_error('No such course!');
+ print_error('invalidcourseid');
}
// require proper login; guest user can not change password
// do not allow "Logged in as" users to change any passwords
if (!empty($USER->realuser)) {
- print_error('Can not use this script when "Logged in as"!');
+ print_error('cannotcallscript');
}
if (is_mnet_remote_user($USER)) {
if ($idprovider = $DB->get_record('mnet_host', array('id'=>$USER->mnethostid))) {
$message .= get_string('userchangepasswordlink', 'mnet', $idprovider);
}
- print_error($message);
+ print_error('userchangepasswordlink', 'mnet', '', $message);
}
// load the appropriate auth plugin
$s = optional_param('s', '', PARAM_CLEAN); // Old parameter: username
if (empty($CFG->registerauth)) {
- print_error("Sorry, you may not use this page.");
+ print_error('cannotusepage2');
}
$authplugin = get_auth_plugin($CFG->registerauth);
if (!$authplugin->can_confirm()) {
- print_error("Sorry, you may not use this page.");
+ print_error('cannotusepage2');
}
if (!empty($data) || (!empty($p) && !empty($s))) {
// The user has confirmed successfully, let's log them in
if (!$USER = get_complete_user_data('username', $username)) {
- print_error("Something serious is wrong with the database");
+ print_error('cannotfinduser', '', '', $username);
}
set_moodle_cookie($USER->username);
print_footer();
exit;
} else {
- print_error("Invalid confirmation data");
+ print_error('invalidconfirmdata');
}
} else {
print_error("errorwhenconfirming");
// check this isn't guest user
if (isguestuser($user)) {
- print_error('You cannot reset the guest password');
+ print_error('cannotresetguestpwd');
}
// make sure user is allowed to change password
// override email stop and mail new password
$user->emailstop = 0;
if (!reset_password_and_mail($user)) {
- print_error('Error resetting password and mailing you');
+ print_error('cannotresetmail');
}
// Clear secret so that it can not be used again
$user->secret = '';
if (!$DB->set_field('user', 'secret', $user->secret, array('id'=>$user->id))) {
- print_error('Error resetting user secret string');
+ print_error('cannotupdatesecret');
}
reset_login_count();
// set 'secret' string
$user->secret = random_string(15);
if (!$DB->set_field('user', 'secret', $user->secret, array('id'=>$user->id))) {
- print_error('error setting user secret string');
+ print_error('cannotupdatesecret');
}
if (!send_password_change_confirmation_email($user)) {
- print_error('error sending password change confirmation email');
+ print_error('cannotmailconfirm');
}
} else {
if (!send_password_change_info($user)) {
- print_error('error sending password change confirmation email');
+ print_error('cannotmailconfirm');
}
}
}
/// Define variables used in page
if (!$site = get_site()) {
- print_error("No site found!");
+ print_error('siteisnotdefined', 'debug');
}
if (empty($CFG->langmenu)) {