Skip to content
Permalink
Browse files

MDL-18440 email_to_user() - avoid some notices ; merged from 19_STABLE

  • Loading branch information...
stronk7
stronk7 committed Mar 4, 2009
1 parent 126d92d commit e0ec2d45b847ac039fb839bc512fed82e8adc018
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/moodlelib.php
@@ -2336,6 +2336,11 @@ function over_bounce_threshold($user) {
if (empty($CFG->handlebounces)) {
return false;
}
if (empty($user->id)) { /// No real (DB) user, nothing to do here.
return false;
}
// set sensible defaults
if (empty($CFG->minbounces)) {
$CFG->minbounces = 10;
@@ -2361,6 +2366,10 @@ function over_bounce_threshold($user) {
function set_send_count($user,$reset=false) {
global $DB;
if (empty($user->id)) { /// No real (DB) user, nothing to do here.
return;
}
if ($pref = $DB->get_record('user_preferences', array('userid'=>$user->id, 'name'=>'email_send_count'))) {
$pref->value = (!empty($reset)) ? 0 : $pref->value+1;
$DB->update_record('user_preferences', $pref);

0 comments on commit e0ec2d4

Please sign in to comment.
You can’t perform that action at this time.