]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13306 option to skip logging of blocked emails in forum cron; merged from MOODLE_...
authorskodak <skodak>
Sun, 3 Feb 2008 10:37:03 +0000 (10:37 +0000)
committerskodak <skodak>
Sun, 3 Feb 2008 10:37:03 +0000 (10:37 +0000)
lang/en_utf8/forum.php
mod/forum/lib.php
mod/forum/settings.php

index 273bfbc54bb86c179d8a1746dde07bbba69b24a6..2caf2fa8db59c8bf56dd7d5936b020a67ec22d1d 100644 (file)
@@ -26,6 +26,7 @@ $string['configcleanreadtime'] = 'The hour of the day to clean old posts from th
 $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 attemts 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['configmaxbytes'] = 'Default maximum size for all forum attachments on the site (subject to course limits and other local settings)';
@@ -115,6 +116,7 @@ $string['introsocial'] = 'An open forum for chatting about anything you want to'
 $string['introteacher'] = 'A forum for teacher-only notes and discussion';
 $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 0cf1ef0cac9d3268f6fa7e50a254a54c571497de..dd86b554659f5df03491ffbfad3b7f7c5d9e7f71 100644 (file)
@@ -292,7 +292,9 @@ function forum_cron() {
                     foreach ($subusers as $postuser) {
                         // do not try to mail users with stopped email
                         if ($postuser->emailstop) {
-                            add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
+                            if (!empty($CFG->forum_logblocked)) {
+                                add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
+                            }
                             continue;
                         }
                         // this user is subscribed to this forum
@@ -500,7 +502,9 @@ function forum_cron() {
                 }
                 $postuser = $users[$digestpost->userid];
                 if ($postuser->emailstop) {
-                    add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
+                    if (!empty($CFG->forum_logblocked)) {
+                        add_to_log(SITEID, 'forum', 'mail blocked', '', '', 0, $postuser->id);
+                    }
                     continue;
                 }
 
index d285fe2c7022efb8c31df2b8cf892107a6bdb70e..4b8529ae860af5e506aa72f115e8a5a2b0d12d1f 100644 (file)
@@ -60,4 +60,7 @@ $settings->add(new admin_setting_configselect('forum_enablerssfeeds', get_string
 $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));
+
 ?>