mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-17943 core_admin: added 'Resend email' link to user list
This commit is contained in:
parent
08c69a1456
commit
81c1e2036b
@ -19,6 +19,7 @@
|
||||
$suspend = optional_param('suspend', 0, PARAM_INT);
|
||||
$unsuspend = optional_param('unsuspend', 0, PARAM_INT);
|
||||
$unlock = optional_param('unlock', 0, PARAM_INT);
|
||||
$resendemail = optional_param('resendemail', 0, PARAM_INT);
|
||||
|
||||
admin_externalpage_setup('editusers');
|
||||
|
||||
@ -37,6 +38,7 @@
|
||||
$strunsuspend = get_string('unsuspenduser', 'admin');
|
||||
$strunlock = get_string('unlockaccount', 'admin');
|
||||
$strconfirm = get_string('confirm');
|
||||
$strresendemail = get_string('resendemail');
|
||||
|
||||
$returnurl = new moodle_url('/admin/user.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage, 'page'=>$page));
|
||||
|
||||
@ -59,6 +61,24 @@
|
||||
redirect($returnurl, get_string('usernotconfirmed', '', fullname($user, true)));
|
||||
}
|
||||
|
||||
} else if ($resendemail && confirm_sesskey()) {
|
||||
if (!$user = $DB->get_record('user', ['id' => $resendemail, 'mnethostid' => $CFG->mnet_localhost_id, 'deleted' => 0])) {
|
||||
print_error('nousers');
|
||||
}
|
||||
|
||||
// Prevent spamming users who are already confirmed.
|
||||
if ($user->confirmed) {
|
||||
print_error('alreadyconfirmed');
|
||||
}
|
||||
|
||||
$returnmsg = get_string('emailconfirmsentsuccess');
|
||||
$messagetype = \core\output\notification::NOTIFY_SUCCESS;
|
||||
if (!send_confirmation_email($user)) {
|
||||
$returnmsg = get_string('emailconfirmsentfailure');
|
||||
$messagetype = \core\output\notification::NOTIFY_ERROR;
|
||||
}
|
||||
|
||||
redirect($returnurl, $returnmsg, null, $messagetype);
|
||||
} else if ($delete and confirm_sesskey()) { // Delete a selected user, after confirmation
|
||||
require_capability('moodle/user:delete', $sitecontext);
|
||||
|
||||
@ -362,6 +382,13 @@
|
||||
} else {
|
||||
$lastcolumn = "<span class=\"dimmed_text\">".get_string('confirm')."</span>";
|
||||
}
|
||||
|
||||
$lastcolumn .= ' | ' . html_writer::link(new moodle_url($returnurl,
|
||||
[
|
||||
'resendemail' => $user->id,
|
||||
'sesskey' => sesskey()
|
||||
]
|
||||
), $strresendemail);
|
||||
}
|
||||
|
||||
if ($user->lastaccess) {
|
||||
|
@ -1651,6 +1651,7 @@ $string['requestedcourses'] = 'Requested courses';
|
||||
$string['requestreason'] = 'Reason for course request';
|
||||
$string['required'] = 'Required';
|
||||
$string['requirespayment'] = 'This course requires payment for access';
|
||||
$string['resendemail'] = 'Resend email';
|
||||
$string['reset'] = 'Reset';
|
||||
$string['resetcomponent'] = 'Component';
|
||||
$string['resetcourse'] = 'Reset course';
|
||||
|
Loading…
x
Reference in New Issue
Block a user