MDL-13811: Small fix to make this work even when email is disabled for that user

This commit is contained in:
moodler
2008-07-10 08:05:52 +00:00
parent 0e27230f3b
commit 69f67b2af4
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -167,6 +167,7 @@
if ($email_changed && $CFG->emailchangeconfirmation) {
$temp_user = fullclone($user);
$temp_user->email = $usernew->preference_newemail;
$temp_user->emailstop = NULL;
$a = new stdClass();
$a->url = $CFG->wwwroot . '/user/emailupdate.php?key=' . $usernew->preference_newemailkey . '&id=' . $user->id;
@@ -176,7 +177,7 @@
$emailupdatemessage = get_string('auth_emailupdatemessage', 'auth', $a);
$emailupdatetitle = get_string('auth_emailupdatetitle', 'auth', $a);
if(!$mail_results = email_to_user($temp_user, get_admin(), $emailupdatetitle, $emailupdatemessage)) {
if (!$mail_results = email_to_user($temp_user, get_admin(), $emailupdatetitle, $emailupdatemessage)) {
die("could not send email!");
}
}
+1
View File
@@ -1,4 +1,5 @@
<?php // $Id$
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/user/editlib.php');