# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/admin/uploaduser.php
--- moodle/admin/uploaduser.php Base (1.123)
+++ moodle/admin/uploaduser.php Locally Modified (Based On 1.123)
@@ -75,7 +75,7 @@
         'maildisplay', 'maildigest', 'htmleditor', 'ajax', 'autosubscribe',
         'mnethostid', 'institution', 'department', 'idnumber', 'skype',
         'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address',
-        'url', 'description', 'descriptionformat', 'oldusername', 'emailstop', 'deleted',
+        'url', 'description', 'descriptionformat', 'oldusername', 'deleted',
         'password');
 
 $PRF_FIELDS = array();
Index: moodle/admin/uploaduser_form.php
--- moodle/admin/uploaduser_form.php Base (1.29)
+++ moodle/admin/uploaduser_form.php Locally Modified (Based On 1.29)
@@ -168,9 +168,6 @@
         $mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
         $mform->setDefault('maildisplay', 2);
 
-        $choices = array(0 => get_string('emailenable'), 1 => get_string('emaildisable'));
-        $mform->addElement('select', 'emailstop', get_string('emailactive'), $choices);
-
         $choices = array(0 => get_string('textformat'), 1 => get_string('htmlformat'));
         $mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
         $mform->setDefault('mailformat', 1);
Index: moodle/backup/moodle2/backup_stepslib.php
--- moodle/backup/moodle2/backup_stepslib.php Base (1.52)
+++ moodle/backup/moodle2/backup_stepslib.php Locally Modified (Based On 1.52)
@@ -996,7 +996,7 @@
         // Then, the fields potentially needing anonymization
         $anonfields = array(
             'username', 'idnumber', 'firstname', 'lastname',
-            'email', 'emailstop', 'icq', 'skype',
+            'email', 'icq', 'skype',
             'yahoo', 'aim', 'msn', 'phone1',
             'phone2', 'institution', 'department', 'address',
             'city', 'country', 'lastip', 'picture',
Index: moodle/backup/util/helper/backup_anonymizer_helper.class.php
--- moodle/backup/util/helper/backup_anonymizer_helper.class.php Base (1.3)
+++ moodle/backup/util/helper/backup_anonymizer_helper.class.php Locally Modified (Based On 1.3)
@@ -78,10 +78,6 @@
         return 'anon' . $counter . '@doesntexist.com'; // Just a counter
     }
 
-    public static function process_user_emailstop($value) {
-        return 1; // Stop email for anon users
-    }
-
     public static function process_user_icq($value) {
         return ''; // Clean icq
     }
Index: moodle/blocks/myprofile/block_myprofile.php
--- moodle/blocks/myprofile/block_myprofile.php Base (1.5)
+++ moodle/blocks/myprofile/block_myprofile.php Locally Modified (Based On 1.5)
@@ -104,7 +104,7 @@
 
         if(!isset($this->config->display_email) || $this->config->display_email == 1) {
             $this->content->text .= '<div class="myprofileitem email">';
-            $this->content->text .= obfuscate_mailto($user->email, '', $user->emailstop);
+            $this->content->text .= obfuscate_mailto($user->email, '');
             $this->content->text .= '</div>';
         }
 
Index: moodle/lib/accesslib.php
--- moodle/lib/accesslib.php Base (1.684)
+++ moodle/lib/accesslib.php Locally Modified (Based On 1.684)
@@ -5101,7 +5101,7 @@
         $fields = 'u.id, u.confirmed, u.username, u.firstname, u.lastname, '.
                   'u.maildisplay, u.mailformat, u.maildigest, u.email, u.city, '.
                   'u.country, u.picture, u.idnumber, u.department, u.institution, '.
-                  'u.emailstop, u.lang, u.timezone, u.lastaccess, u.mnethostid, r.name AS rolename, r.sortorder';
+                  'u.lang, u.timezone, u.lastaccess, u.mnethostid, r.name AS rolename, r.sortorder';
     }
 
     $parentcontexts = '';
Index: moodle/lib/cronlib.php
--- moodle/lib/cronlib.php Base (1.10)
+++ moodle/lib/cronlib.php Locally Modified (Based On 1.10)
@@ -297,7 +297,6 @@
                                                WHERE p.name='create_password' AND p.value='1' AND u.email !='' ");
 
             foreach ($newusers as $newuserid => $newuser) {
-                $newuser->emailstop = 0; // send email regardless
\ No newline at end of file
                 // email user
                 if (setnew_password_and_mail($newuser)) {
                     // remove user pref
Index: moodle/lib/db/install.xml
--- moodle/lib/db/install.xml Base (1.283)
+++ moodle/lib/db/install.xml Locally Modified (Based On 1.283)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20101026" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20101105" COMMENT="XMLDB file for core Moodle tables"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
 >
@@ -723,9 +723,8 @@
         <FIELD NAME="idnumber" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="password" NEXT="firstname"/>
         <FIELD NAME="firstname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="idnumber" NEXT="lastname"/>
         <FIELD NAME="lastname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="firstname" NEXT="email"/>
-        <FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="lastname" NEXT="emailstop"/>
-        <FIELD NAME="emailstop" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="email" NEXT="icq"/>
-        <FIELD NAME="icq" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" PREVIOUS="emailstop" NEXT="skype"/>
\ No newline at end of file
+        <FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="lastname" NEXT="icq"/>
+        <FIELD NAME="icq" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" PREVIOUS="email" NEXT="skype"/>
\ No newline at end of file
         <FIELD NAME="skype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="icq" NEXT="yahoo"/>
         <FIELD NAME="yahoo" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="skype" NEXT="aim"/>
         <FIELD NAME="aim" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="yahoo" NEXT="msn"/>
Index: moodle/lib/db/upgrade.php
--- moodle/lib/db/upgrade.php Base (1.503)
+++ moodle/lib/db/upgrade.php Locally Modified (Based On 1.503)
@@ -5393,9 +5393,17 @@
         upgrade_main_savepoint(true, 2010110200);
     }
 
+    //remove forum_logblocked from config. No longer required after user->emailstop was removed
+    if ($oldversion < 2010110500) {
+        unset_config('forum_logblocked');
+        upgrade_main_savepoint(true, 2010110500);
+    }
+
     return true;
 }
 
 //TODO: Cleanup before the 2.0 release - we do not want to drag along these dev machine fixes forever
 // 1/ drop block_pinned_old table here and in install.xml
 // 2/ drop block_instance_old table here and in install.xml
+
+//TODO: AFTER 2.0 remove the column user->emailstop and the user preference "message_showmessagewindow"
Index: moodle/lib/messagelib.php
--- moodle/lib/messagelib.php Base (1.31)
+++ moodle/lib/messagelib.php Locally Modified (Based On 1.31)
@@ -296,25 +296,34 @@
 function message_set_default_message_preferences($user) {
     global $DB;
 
-    $defaultonlineprocessor = 'email';
-    $defaultofflineprocessor = 'email';
-    $offlineprocessortouse = $onlineprocessortouse = null;
+    //check for the pre 2.0 disable email setting
+    $useemail = empty($user->emailstop);
 
     //look for the pre-2.0 preference if it exists
     $oldpreference = get_user_preferences('message_showmessagewindow', -1, $user->id);
     //if they elected to see popups or the preference didnt exist
     $usepopups = (intval($oldpreference)==1 || intval($oldpreference)==-1);
 
+    $defaultonlineprocessor = 'none';
+    $defaultofflineprocessor = 'none';
 
+    if ($useemail) {
+        $defaultonlineprocessor = 'email';
+        $defaultofflineprocessor = 'email';
+    } else if ($usepopups) {
+        $defaultonlineprocessor = 'popup';
+        $defaultofflineprocessor = 'popup';
+    }
+
+    $offlineprocessortouse = $onlineprocessortouse = null;
+
     $providers = $DB->get_records('message_providers');
     $preferences = array();
 
     foreach ($providers as $providerid => $provider) {
 
-        //force some specific defaults for some types of message
-
-        //if old popup preference was set to 1 or is missing use popups for IMs
-        if ($provider->name=='instantmessage' && $usepopups) {
+        //force some specific defaults for IMs
+        if ($provider->name=='instantmessage' && $usepopups && $useemail) {
             $onlineprocessortouse = 'popup';
             $offlineprocessortouse = 'email,popup';
         } else {
Index: moodle/lib/moodlelib.php
--- moodle/lib/moodlelib.php Base (1.1496)
+++ moodle/lib/moodlelib.php Locally Modified (Based On 1.1496)
@@ -4727,8 +4727,7 @@
  * @param string $replyto Email address to reply to
  * @param string $replytoname Name of reply to recipient
  * @param int $wordwrapwidth custom word wrap width, default 79
- * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return bool|string Returns "true" if mail was sent OK and "false" if there was an error.
  */
 function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $attachment='', $attachname='', $usetrueaddress=true, $replyto='', $replytoname='', $wordwrapwidth=79) {
 
@@ -4762,10 +4761,6 @@
         return true;
     }
 
-    if (!empty($user->emailstop)) {
-        return 'emailstop';
-    }
-
     if (over_bounce_threshold($user)) {
         $bouncemsg = "User $user->id (".fullname($user).") is over bounce threshold! Not sending.";
         error_log($bouncemsg);
@@ -4974,8 +4969,7 @@
  * @global object
  * @global object
  * @param user $user A {@link $USER} object
- * @return boolean|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return boolean|string Returns "true" if mail was sent OK and "false" if there was an error
  */
 function setnew_password_and_mail($user) {
     global $CFG, $DB;
@@ -5009,8 +5003,7 @@
  *
  * @global object
  * @param user $user A {@link $USER} object
- * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return bool|string Returns "true" if mail was sent OK and "false" if there was an error.
  */
 function reset_password_and_mail($user) {
     global $CFG;
@@ -5052,8 +5045,7 @@
  *
  * @global object
  * @param user $user A {@link $USER} object
- * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return bool|string Returns "true" if mail was sent OK and "false" if there was an error.
  */
  function send_confirmation_email($user) {
     global $CFG;
@@ -5083,8 +5075,7 @@
  *
  * @global object
  * @param user $user A {@link $USER} object
- * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return bool|string Returns "true" if mail was sent OK and "false" if there was an error.
  */
 function send_password_change_confirmation_email($user) {
     global $CFG;
@@ -5111,8 +5102,7 @@
  *
  * @global object
  * @param user $user A {@link $USER} object
- * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
- *          was blocked by user and "false" if there was another sort of error.
+ * @return bool|string Returns "true" if mail was sent OK and "false" if there was an error.
  */
 function send_password_change_info($user) {
     global $CFG;
Index: moodle/lib/setup.php
--- moodle/lib/setup.php Base (1.343)
+++ moodle/lib/setup.php Locally Modified (Based On 1.343)
@@ -242,7 +242,6 @@
  * $USER is stored in the session.
  *
  * Items found in the user record:
- *  - $USER->emailstop - Does the user want email sent to them?
  *  - $USER->email - The user's email address.
  *  - $USER->id - The unique integer identified of this user in the 'user' table.
  *  - $USER->email - The user's email address.
Index: moodle/login/forgot_password.php
--- moodle/login/forgot_password.php Base (1.69)
+++ moodle/login/forgot_password.php Locally Modified (Based On 1.69)
@@ -80,8 +80,6 @@
         // make sure user is allowed to change password
         require_capability('moodle/user:changeownpassword', $systemcontext, $user->id);
 
-        // override email stop and mail new password
-        $user->emailstop = 0;
         if (!reset_password_and_mail($user)) {
             print_error('cannotresetmail');
         }
@@ -132,8 +130,7 @@
 
         $userauth = get_auth_plugin($user->auth);
         if (has_capability('moodle/user:changeownpassword', $systemcontext, $user->id)) {
-            // send email (make sure mail block is off)
-            $user->emailstop = 0;
+            // send email
         }
 
         if ($userauth->can_reset_password() and is_enabled_auth($user->auth)
Index: moodle/message/output/email/message_output_email.php
--- moodle/message/output/email/message_output_email.php Base (1.16)
+++ moodle/message/output/email/message_output_email.php Locally Modified (Based On 1.16)
@@ -56,7 +56,7 @@
         $result = email_to_user($eventdata->userto, $eventdata->userfrom,
             $eventdata->subject, $eventdata->fullmessage, $eventdata->fullmessagehtml);
 
-        return ($result===true || $result=='emailstop'); //email_to_user() can return true, false or "emailstop"
+        return $result;
     }
 
     /**
Index: moodle/mod/forum/lang/en/forum.php
--- moodle/mod/forum/lang/en/forum.php Base (1.24)
+++ moodle/mod/forum/lang/en/forum.php Locally Modified (Based On 1.24)
@@ -87,7 +87,6 @@
 $string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.';
 $string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all forums.  You will still need to turn feeds on manually in the settings for each forum.';
 $string['configenabletimedposts'] = 'Set to \'yes\' if you want to allow setting of display periods when posting a new forum discussion (Experimental as not yet fully tested)';
-$string['configlogblocked'] = 'Forum cron may log blocked attempts to send emails to users with disabled email.';
 $string['configlongpost'] = 'Any post over this length (in characters not including HTML) is considered long. Posts displayed on the site front page, social format course pages, or user profiles are shortened to a natural break somewhere between the forum_shortpost and forum_longpost values.';
 $string['configmanydiscussions'] = 'Maximum number of discussions shown in a forum per page';
 $string['configmaxattachments'] = 'Default maximum number of attachments allowed per post.';
@@ -199,7 +198,6 @@
 $string['invalidpostid'] = 'Invalid Post ID - {$a}';
 $string['lastpost'] = 'Last post';
 $string['learningforums'] = 'Learning forums';
-$string['logblocked'] = 'Log blocked emails';
 $string['longpost'] = 'Long post';
 $string['mailnow'] = 'Mail now';
 $string['manydiscussions'] = 'Discussions per page';
Index: moodle/mod/forum/lib.php
--- moodle/mod/forum/lib.php Base (1.914)
+++ moodle/mod/forum/lib.php Locally Modified (Based On 1.914)
@@ -464,13 +464,6 @@
                 $modcontext = get_context_instance(CONTEXT_MODULE, $coursemodules[$forumid]->id);
                 if ($subusers = forum_subscribed_users($courses[$courseid], $forums[$forumid], 0, $modcontext)) {
                     foreach ($subusers as $postuser) {
-                        // do not try to mail users with stopped email
-                        if ($postuser->emailstop) {
-                            if (!empty($CFG->forum_logblocked)) {
-                                add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
-                            }
-                            continue;
-                        }
                         // this user is subscribed to this forum
                         $subscribedusers[$forumid][$postuser->id] = $postuser->id;
                         // this user is a user we have to process later
@@ -654,9 +647,6 @@
                     add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#p$post->id",
                                substr(format_string($post->subject,true),0,30), $cm->id, $userto->id);
                     $errorcount[$post->id]++;
-                } else if ($mailresult === 'emailstop') {
-                    // should not be reached anymore - see check above
-                    mtrace("Error: mod/forum/lib.php forum_cron(): received 'emailstop' while sending out mail for id $post->id to user $userto->id ($userto->email)");
                 } else {
                     $mailcount[$post->id]++;
 
@@ -734,12 +724,6 @@
                     }
                 }
                 $postuser = $users[$digestpost->userid];
-                if ($postuser->emailstop) {
-                    if (!empty($CFG->forum_logblocked)) {
-                        add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
-                    }
-                    continue;
-                }
 
                 if (!isset($posts[$digestpost->postid])) {
                     if ($post = $DB->get_record('forum_posts', array('id' => $digestpost->postid))) {
@@ -941,8 +925,6 @@
                     mtrace("ERROR!");
                     echo "Error: mod/forum/cron.php: Could not send out digest mail to user $userto->id ($userto->email)... not trying again.\n";
                     add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);
-                } else if ($mailresult === 'emailstop') {
-                    // should not happen anymore - see check above
                 } else {
                     mtrace("success.");
                     $usermailcount++;
@@ -2837,7 +2819,6 @@
               u.maildisplay,
               u.mailformat,
               u.maildigest,
-              u.emailstop,
               u.imagealt,
               u.email,
               u.city,
Index: moodle/mod/forum/settings.php
--- moodle/mod/forum/settings.php Base (1.13)
+++ moodle/mod/forum/settings.php Locally Modified (Based On 1.13)
@@ -87,8 +87,5 @@
 
     $settings->add(new admin_setting_configcheckbox('forum_enabletimedposts', get_string('timedposts', 'forum'),
                        get_string('configenabletimedposts', 'forum'), 0));
-
-    $settings->add(new admin_setting_configcheckbox('forum_logblocked', get_string('logblocked', 'forum'),
-                       get_string('configlogblocked', 'forum'), 1));
 }
 
Index: moodle/mod/quiz/locallib.php
--- moodle/mod/quiz/locallib.php Base (1.201)
+++ moodle/mod/quiz/locallib.php Locally Modified (Based On 1.201)
@@ -1077,7 +1077,7 @@
 function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm) {
     global $CFG, $USER;
     // we will count goods and bads for error logging
-    $emailresult = array('good' => 0, 'block' => 0, 'fail' => 0);
+    $emailresult = array('good' => 0, 'fail' => 0);
 
     // do nothing if required objects not present
     if (empty($course) or empty($quiz) or empty($attempt) or empty($context)) {
@@ -1097,7 +1097,7 @@
     }
 
     // check for notifications required
-    $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.emailstop, u.lang, u.timezone, u.mailformat, u.maildisplay';
+    $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.lang, u.timezone, u.mailformat, u.maildisplay';
     $groups = groups_get_all_groups($course->id, $USER->id);
     if (is_array($groups) && count($groups) > 0) {
         $groups = array_keys($groups);
@@ -1145,9 +1145,6 @@
             case false:
                 $emailresult['fail']++;
                 break;
-            case 'emailstop':
-                $emailresult['block']++;
-                break;
         }
     }
 
@@ -1162,9 +1159,6 @@
                 case false:
                     $emailresult['fail']++;
                     break;
-                case 'emailstop':
-                    $emailresult['block']++;
-                    break;
             }
         }
     }
@@ -1173,9 +1167,6 @@
     if (! empty($emailresult['fail'])) {
         debugging('quiz_send_notification_emails:: '.$emailresult['fail'].' email(s) failed to be sent.', DEBUG_DEVELOPER);
     }
-    if (! empty($emailresult['block'])) {
-        debugging('quiz_send_notification_emails:: '.$emailresult['block'].' email(s) were blocked by the user.', DEBUG_DEVELOPER);
-    }
 
     // return the number of successfully sent emails
     return $emailresult['good'];
Index: moodle/user/edit.php
--- moodle/user/edit.php Base (1.208)
+++ moodle/user/edit.php Locally Modified (Based On 1.208)
@@ -219,7 +219,6 @@
     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;
Index: moodle/user/editlib.php
--- moodle/user/editlib.php Base (1.49)
+++ moodle/user/editlib.php Locally Modified (Based On 1.49)
@@ -123,12 +123,6 @@
     $mform->setDefault('maildisplay', 2);
 
     $choices = array();
-    $choices['0'] = get_string('emailenable');
-    $choices['1'] = get_string('emaildisable');
-    $mform->addElement('select', 'emailstop', get_string('emailactive'), $choices);
-    $mform->setDefault('emailstop', 0);
-
-    $choices = array();
     $choices['0'] = get_string('textformat');
     $choices['1'] = get_string('htmlformat');
     $mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
Index: moodle/user/externallib.php
--- moodle/user/externallib.php Base (1.31)
+++ moodle/user/externallib.php Locally Modified (Based On 1.31)
@@ -47,7 +47,6 @@
                             'email'       => new external_value(PARAM_EMAIL, 'A valid and unique email address'),
                             'auth'        => new external_value(PARAM_SAFEDIR, 'Auth plugins include manual, ldap, imap, etc', VALUE_DEFAULT, 'manual', NULL_NOT_ALLOWED),
                             'idnumber'    => new external_value(PARAM_RAW, 'An arbitrary ID code number perhaps from the institution', VALUE_DEFAULT, ''),
-                            'emailstop'   => new external_value(PARAM_NUMBER, 'Email is blocked: 1 is blocked and 0 otherwise', VALUE_DEFAULT, 0),
                             'lang'        => new external_value(PARAM_SAFEDIR, 'Language code such as "en", must exist on server', VALUE_DEFAULT, $CFG->lang, NULL_NOT_ALLOWED),
                             'theme'       => new external_value(PARAM_SAFEDIR, 'Theme name such as "standard", must exist on server', VALUE_OPTIONAL),
                             'timezone'    => new external_value(PARAM_ALPHANUMEXT, 'Timezone code such as Australia/Perth, or 99 for default', VALUE_OPTIONAL),
@@ -255,7 +254,6 @@
                             'email'       => new external_value(PARAM_EMAIL, 'A valid and unique email address', VALUE_OPTIONAL, '',NULL_NOT_ALLOWED),
                             'auth'        => new external_value(PARAM_SAFEDIR, 'Auth plugins include manual, ldap, imap, etc', VALUE_OPTIONAL, '', NULL_NOT_ALLOWED),
                             'idnumber'    => new external_value(PARAM_RAW, 'An arbitrary ID code number perhaps from the institution', VALUE_OPTIONAL),
-                            'emailstop'   => new external_value(PARAM_NUMBER, 'Email is blocked: 1 is blocked and 0 otherwise', VALUE_OPTIONAL),
                             'lang'        => new external_value(PARAM_SAFEDIR, 'Language code such as "en", must exist on server', VALUE_OPTIONAL, '', NULL_NOT_ALLOWED),
                             'theme'       => new external_value(PARAM_SAFEDIR, 'Theme name such as "standard", must exist on server', VALUE_OPTIONAL),
                             'timezone'    => new external_value(PARAM_ALPHANUMEXT, 'Timezone code such as Australia/Perth, or 99 for default', VALUE_OPTIONAL),
@@ -391,7 +389,6 @@
                 $userarray['auth'] = $user->auth;
                 $userarray['confirmed'] = $user->confirmed;
                 $userarray['idnumber'] = $user->idnumber;
-                $userarray['emailstop'] = $user->emailstop;
                 $userarray['lang'] = $user->lang;
                 $userarray['theme'] = $user->theme;
                 $userarray['timezone'] = $user->timezone;
@@ -430,7 +427,6 @@
                     'auth'        => new external_value(PARAM_SAFEDIR, 'Auth plugins include manual, ldap, imap, etc'),
                     'confirmed'   => new external_value(PARAM_NUMBER, 'Active user: 1 if confirmed, 0 otherwise'),
                     'idnumber'    => new external_value(PARAM_RAW, 'An arbitrary ID code number perhaps from the institution'),
-                    'emailstop'   => new external_value(PARAM_NUMBER, 'Email is blocked: 1 is blocked and 0 otherwise'),
                     'lang'        => new external_value(PARAM_SAFEDIR, 'Language code such as "en", must exist on server'),
                     'theme'       => new external_value(PARAM_SAFEDIR, 'Theme name such as "standard", must exist on server'),
                     'timezone'    => new external_value(PARAM_ALPHANUMEXT, 'Timezone code such as Australia/Perth, or 99 for default'),
Index: moodle/user/index.php
--- moodle/user/index.php Base (1.287)
+++ moodle/user/index.php Locally Modified (Based On 1.287)
@@ -374,7 +374,7 @@
     if ($isfrontpage) {
         $select = "SELECT u.id, u.username, u.firstname, u.lastname,
                           u.email, u.city, u.country, u.picture,
-                          u.lang, u.timezone, u.emailstop, u.maildisplay, u.imagealt,
+                          u.lang, u.timezone, u.maildisplay, u.imagealt,
                           u.lastaccess";
         $joins[] = "JOIN ($esql) e ON e.id = u.id"; // everybody on the frontpage usually
         if ($accesssince) {
@@ -384,7 +384,7 @@
     } else {
         $select = "SELECT u.id, u.username, u.firstname, u.lastname,
                           u.email, u.city, u.country, u.picture,
-                          u.lang, u.timezone, u.emailstop, u.maildisplay, u.imagealt,
+                          u.lang, u.timezone, u.maildisplay, u.imagealt,
                           COALESCE(ul.timeaccess, 0) AS lastaccess";
         $joins[] = "JOIN ($esql) e ON e.id = u.id"; // course enrolled users only
         $joins[] = "LEFT JOIN {user_lastaccess} ul ON (ul.userid = u.id AND ul.courseid = :courseid)"; // not everybody accessed course yet
Index: moodle/user/message.html
--- moodle/user/message.html Base (1.16)
+++ moodle/user/message.html Locally Modified (Based On 1.16)
@@ -35,9 +35,7 @@
     if (count($SESSION->emailto[$id])) {
         foreach ($SESSION->emailto[$id] as $user) {
             echo '<tr><td>'.fullname($user,true).'</td><td>'.$user->email.'</td><td>';
-            if ($user->emailstop) {
-                $error = get_string('emaildisable');
-            } elseif (empty($user->email)) {
+            if (empty($user->email)) {
                 $error = get_string('emailempty');
             }
             if (!empty($error)) {
Index: moodle/user/messageselect.php
--- moodle/user/messageselect.php Base (1.37)
+++ moodle/user/messageselect.php Locally Modified (Based On 1.37)
@@ -94,7 +94,7 @@
 foreach ($_POST as $k => $v) {
     if (preg_match('/^(user|teacher)(\d+)$/',$k,$m)) {
         if (!array_key_exists($m[2],$SESSION->emailto[$id])) {
-            if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) {
+            if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,mailformat,lastaccess')) {
                 $SESSION->emailto[$id][$m[2]] = $user;
                 $count++;
             }
Index: moodle/user/profile.php
--- moodle/user/profile.php Base (1.15)
+++ moodle/user/profile.php Locally Modified (Based On 1.15)
@@ -249,49 +249,9 @@
    or ($user->maildisplay == 2 && !isguestuser())
    or has_capability('moodle/course:useremail', $context)) {
 
-    $emailswitch = '';
-
-    if ($currentuser or has_capability('moodle/course:useremail', $context)) {   /// Can use the enable/disable email stuff
-        if (!empty($enable) and confirm_sesskey()) {     /// Recieved a parameter to enable the email address
-            $DB->set_field('user', 'emailstop', 0, array('id'=>$user->id));
-            $user->emailstop = 0;
+    print_row(get_string("email").":", obfuscate_mailto($user->email, ''));
         }
-        if (!empty($disable) and confirm_sesskey()) {     /// Recieved a parameter to disable the email address
-            $DB->set_field('user', 'emailstop', 1, array('id'=>$user->id));
-            $user->emailstop = 1;
-        }
-    }
 
-    if (has_capability('moodle/course:useremail', $context)) {   /// Can use the enable/disable email stuff
-        if ($user->emailstop) {
-            $switchparam = 'enable';
-            $switchtitle = get_string('emaildisable');
-            $switchclick = get_string('emailenableclick');
-            $switchpix   = 't/emailno';
-        } else {
-            $switchparam = 'disable';
-            $switchtitle = get_string('emailenable');
-            $switchclick = get_string('emaildisableclick');
-            $switchpix   = 't/email';
-        }
-        $emailswitch = "&nbsp;<a title=\"$switchclick\" ".
-                       "href=\"profile.php?id=$user->id&amp;$switchparam=1&amp;sesskey=".sesskey()."\">".
-                       "<img src=\"" . $OUTPUT->pix_url("$switchpix") . "\" alt=\"$switchclick\" /></a>";
-
-    } else if ($currentuser) {         /// Can only re-enable an email this way
-        if ($user->emailstop) {   // Include link that tells how to re-enable their email
-            $switchparam = 'enable';
-            $switchtitle = get_string('emaildisable');
-            $switchclick = get_string('emailenableclick');
-
-            $emailswitch = "&nbsp;(<a title=\"$switchclick\" ".
-                           "href=\"profile.php?id=$user->id&amp;enable=1&amp;sesskey=".sesskey()."\">$switchtitle</a>)";
-        }
-    }
-
-    print_row(get_string("email").":", obfuscate_mailto($user->email, '', $user->emailstop)."$emailswitch");
-}
-
 if ($user->url && !isset($hiddenfields['webpage'])) {
     $url = $user->url;
     if (strpos($user->url, '://') === false) {
Index: moodle/version.php
--- moodle/version.php Base (1.1826)
+++ moodle/version.php Locally Modified (Based On 1.1826)
@@ -29,7 +29,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$version = 2010110201;  // YYYYMMDD   = date of the last version bump
+$version = 2010110500;  // YYYYMMDD   = date of the last version bump
                         //         XX = daily increments
 
 $release = '2.0 RC1 (Build: 20101105)';  // Human-friendly version name
Index: moodle/webservice/simpletest/testwebservice.php
--- moodle/webservice/simpletest/testwebservice.php Base (1.3)
+++ moodle/webservice/simpletest/testwebservice.php Locally Modified (Based On 1.3)
@@ -454,7 +454,6 @@
         $user1->email = 'testemail1@moodle.com';
         $user1->auth = 'manual';
         $user1->idnumber = 'testidnumber1';
-        $user1->emailstop = 1;
         $user1->lang = 'en';
         $user1->theme = 'standard';
         $user1->timezone = 99;
@@ -522,7 +521,6 @@
         $this->assertEqual($dbuser1->email, $user1->email);
         $this->assertEqual($dbuser1->auth, $user1->auth);
         $this->assertEqual($dbuser1->idnumber, $user1->idnumber);
-        $this->assertEqual($dbuser1->emailstop, $user1->emailstop);
         $this->assertEqual($dbuser1->lang, $user1->lang);
         $this->assertEqual($dbuser1->theme, $user1->theme);
         $this->assertEqual($dbuser1->timezone, $user1->timezone);
