mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Merge branch 'MDL-24860_messaging_providers' of git://github.com/andyjdavis/moodle
Conflicts: mod/lesson/version.php
This commit is contained in:
commit
1310964bb3
10 changed files with 51 additions and 2 deletions
|
@ -303,6 +303,7 @@ class enrol_self_plugin extends enrol_plugin {
|
||||||
$contact = get_admin();
|
$contact = get_admin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//directly emailing welcome message rather than using messaging
|
||||||
email_to_user($user, $contact, $subject, $message);
|
email_to_user($user, $contact, $subject, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1695,6 +1695,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
|
||||||
|
|
||||||
$lasttime = get_config('admin', 'lastloginserterrormail');
|
$lasttime = get_config('admin', 'lastloginserterrormail');
|
||||||
if(empty($lasttime) || time() - $lasttime > 60*60*24) { // limit to 1 email per day
|
if(empty($lasttime) || time() - $lasttime > 60*60*24) { // limit to 1 email per day
|
||||||
|
//using email directly rather than messaging as they may not be able to log in to access a message
|
||||||
mail($CFG->supportemail, $subject, $message);
|
mail($CFG->supportemail, $subject, $message);
|
||||||
set_config('lastloginserterrormail', time(), 'admin');
|
set_config('lastloginserterrormail', time(), 'admin');
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,6 +284,7 @@ function setup_DB() {
|
||||||
$content = @fread($fp, 24);
|
$content = @fread($fp, 24);
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
if((time() - (int)$content) > 600){
|
if((time() - (int)$content) > 600){
|
||||||
|
//email directly rather than using messaging
|
||||||
@mail($CFG->emailconnectionerrorsto,
|
@mail($CFG->emailconnectionerrorsto,
|
||||||
'WARNING: Database connection error: '.$CFG->wwwroot,
|
'WARNING: Database connection error: '.$CFG->wwwroot,
|
||||||
'Connection error: '.$CFG->wwwroot);
|
'Connection error: '.$CFG->wwwroot);
|
||||||
|
@ -291,6 +292,7 @@ function setup_DB() {
|
||||||
@fwrite($fp, time());
|
@fwrite($fp, time());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//email directly rather than using messaging
|
||||||
@mail($CFG->emailconnectionerrorsto,
|
@mail($CFG->emailconnectionerrorsto,
|
||||||
'WARNING: Database connection error: '.$CFG->wwwroot,
|
'WARNING: Database connection error: '.$CFG->wwwroot,
|
||||||
'Connection error: '.$CFG->wwwroot);
|
'Connection error: '.$CFG->wwwroot);
|
||||||
|
|
|
@ -5024,6 +5024,7 @@ function setnew_password_and_mail($user) {
|
||||||
|
|
||||||
$subject = format_string($site->fullname) .': '. get_string('newusernewpasswordsubj');
|
$subject = format_string($site->fullname) .': '. get_string('newusernewpasswordsubj');
|
||||||
|
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message);
|
return email_to_user($user, $supportuser, $subject, $message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5066,6 +5067,7 @@ function reset_password_and_mail($user) {
|
||||||
|
|
||||||
$subject = format_string($site->fullname) .': '. get_string('changedpassword');
|
$subject = format_string($site->fullname) .': '. get_string('changedpassword');
|
||||||
|
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message);
|
return email_to_user($user, $supportuser, $subject, $message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5096,6 +5098,7 @@ function reset_password_and_mail($user) {
|
||||||
|
|
||||||
$user->mailformat = 1; // Always send HTML version as well
|
$user->mailformat = 1; // Always send HTML version as well
|
||||||
|
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
|
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5123,6 +5126,7 @@ function send_password_change_confirmation_email($user) {
|
||||||
$message = get_string('emailpasswordconfirmation', '', $data);
|
$message = get_string('emailpasswordconfirmation', '', $data);
|
||||||
$subject = get_string('emailpasswordconfirmationsubject', '', format_string($site->fullname));
|
$subject = get_string('emailpasswordconfirmationsubject', '', format_string($site->fullname));
|
||||||
|
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message);
|
return email_to_user($user, $supportuser, $subject, $message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5152,6 +5156,7 @@ function send_password_change_info($user) {
|
||||||
if (!is_enabled_auth($user->auth) or $user->auth == 'nologin') {
|
if (!is_enabled_auth($user->auth) or $user->auth == 'nologin') {
|
||||||
$message = get_string('emailpasswordchangeinfodisabled', '', $data);
|
$message = get_string('emailpasswordchangeinfodisabled', '', $data);
|
||||||
$subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
|
$subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message);
|
return email_to_user($user, $supportuser, $subject, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5172,6 +5177,7 @@ function send_password_change_info($user) {
|
||||||
$subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
|
$subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||||
return email_to_user($user, $supportuser, $subject, $message);
|
return email_to_user($user, $supportuser, $subject, $message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8029,6 +8035,7 @@ function notify_login_failures() {
|
||||||
/// For each destination, send mail
|
/// For each destination, send mail
|
||||||
mtrace('Emailing admins about '. $count .' failed login attempts');
|
mtrace('Emailing admins about '. $count .' failed login attempts');
|
||||||
foreach ($recip as $admin) {
|
foreach ($recip as $admin) {
|
||||||
|
//emailing the admins directly rather than putting these through the messaging system
|
||||||
email_to_user($admin,get_admin(), $subject, $body);
|
email_to_user($admin,get_admin(), $subject, $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
/**
|
/**
|
||||||
* Defines message providers (types of messages being sent)
|
* Defines message providers (types of messages being sent)
|
||||||
*
|
*
|
||||||
* @package mod-assignment
|
* @package mod-feedback
|
||||||
* @copyright 2010 onwards Aparup Banerjee http://moodle.com
|
* @copyright 2010 onwards Aparup Banerjee http://moodle.com
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -920,6 +920,7 @@ function forum_cron() {
|
||||||
|
|
||||||
$attachment = $attachname='';
|
$attachment = $attachname='';
|
||||||
$usetrueaddress = true;
|
$usetrueaddress = true;
|
||||||
|
//directly email forum digests rather than sending them via messaging
|
||||||
$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname, $usetrueaddress, $CFG->forum_replytouser);
|
$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname, $usetrueaddress, $CFG->forum_replytouser);
|
||||||
|
|
||||||
if (!$mailresult) {
|
if (!$mailresult) {
|
||||||
|
|
35
mod/lesson/db/messages.php
Normal file
35
mod/lesson/db/messages.php
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// This file is part of Moodle - http://moodle.org/
|
||||||
|
//
|
||||||
|
// Moodle is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Moodle is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines message providers (types of messages being sent)
|
||||||
|
*
|
||||||
|
* @package mod-lesson
|
||||||
|
* @copyright 2010 Andrew Davis
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
$messageproviders = array (
|
||||||
|
|
||||||
|
// essay graded notification
|
||||||
|
'graded_essay' => array (
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,7 @@ $string['mediafile_help'] = 'To include a pop-up window at the beginning of a le
|
||||||
$string['mediafilepopup'] = 'Click here to view';
|
$string['mediafilepopup'] = 'Click here to view';
|
||||||
$string['mediaheight'] = 'Popup window height:';
|
$string['mediaheight'] = 'Popup window height:';
|
||||||
$string['mediawidth'] = 'Popup window width:';
|
$string['mediawidth'] = 'Popup window width:';
|
||||||
|
$string['messageprovider:graded_essay'] = 'Essay graded notification';
|
||||||
$string['minimumnumberofquestions'] = 'Minimum number of questions';
|
$string['minimumnumberofquestions'] = 'Minimum number of questions';
|
||||||
$string['minimumnumberofquestions_help'] = 'This setting specifies the minimum number of questions that will be used to calculate a grade for the activity. If the lesson contains one or more content pages, the minimum number of questions should be set to zero.
|
$string['minimumnumberofquestions_help'] = 'This setting specifies the minimum number of questions that will be used to calculate a grade for the activity. If the lesson contains one or more content pages, the minimum number of questions should be set to zero.
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$module->version = 2010121400; // The current module version (Date: YYYYMMDDXX)
|
$module->version = 2010122200; // The current module version (Date: YYYYMMDDXX)
|
||||||
$module->requires = 2010080300; // Requires this Moodle version
|
$module->requires = 2010080300; // Requires this Moodle version
|
||||||
$module->cron = 0; // Period for cron to check this module (secs)
|
$module->cron = 0; // Period for cron to check this module (secs)
|
||||||
|
|
||||||
|
|
|
@ -228,6 +228,7 @@ if ($usernew = $userform->get_data()) {
|
||||||
$emailupdatemessage = get_string('auth_emailupdatemessage', 'auth_email', $a);
|
$emailupdatemessage = get_string('auth_emailupdatemessage', 'auth_email', $a);
|
||||||
$emailupdatetitle = get_string('auth_emailupdatetitle', 'auth_email', $a);
|
$emailupdatetitle = get_string('auth_emailupdatetitle', 'auth_email', $a);
|
||||||
|
|
||||||
|
//email confirmation directly rather than using messaging so they will definitely get an email
|
||||||
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!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue