MDL-13811: Merged fix to work when email is disabled
authormoodler <moodler>
Thu, 10 Jul 2008 08:07:55 +0000 (08:07 +0000)
committermoodler <moodler>
Thu, 10 Jul 2008 08:07:55 +0000 (08:07 +0000)
user/edit.php
user/emailupdate.php

index 4af4102..064fb30 100644 (file)
         if ($email_changed && $CFG->emailchangeconfirmation) {
             $temp_user = fullclone($user);
             $temp_user->email = $usernew->preference_newemail;
         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;
 
             $a = new stdClass();
             $a->url = $CFG->wwwroot . '/user/emailupdate.php?key=' . $usernew->preference_newemailkey . '&id=' . $user->id;
             $emailupdatemessage = get_string('auth_emailupdatemessage', 'auth', $a);
             $emailupdatetitle = get_string('auth_emailupdatetitle', 'auth', $a);
 
             $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!");
             }
         }
                 die("could not send email!");
             }
         }
index 6a68013..6273ab3 100755 (executable)
@@ -1,4 +1,5 @@
 <?php // $Id$
 <?php // $Id$
+
 require_once('../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot.'/user/editlib.php');
 require_once('../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot.'/user/editlib.php');