Skip to content

Commit

Permalink
MDL-10107 - Removed old email_to_user with we still arround and added…
Browse files Browse the repository at this point in the history
… default message processor for user,

adminuser and on messagelib
  • Loading branch information
lfrodrigues committed Aug 2, 2008
1 parent 8fdfa54 commit 2044a2b
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 202 deletions.
13 changes: 0 additions & 13 deletions admin/handlevirus.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ function notify_user($user,$subject,$a) {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);


/*
email_to_user($user,get_admin(),$subject,$body);
*/
}


Expand All @@ -96,10 +91,6 @@ function notify_admins($user,$subject,$a) {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin,$admin,$subject,$body);
*/
}
}

Expand All @@ -121,10 +112,6 @@ function notify_admins_unknown($file,$a) {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin,$admin,$subject,$body);
*/
}
}

Expand Down
5 changes: 0 additions & 5 deletions backup/backup_scheduled.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,8 @@ function schedule_backup_cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin,$admin,$subject,$message);
*/
}


//Everything is finished stop backup_sche_running
backup_set_config("backup_sche_running","0");

Expand Down
7 changes: 1 addition & 6 deletions course/pending.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($user,$USER,get_string('courseapprovedsubject'),get_string('courseapprovedemail','moodle',$a));
*/
redirect($CFG->wwwroot.'/course/edit.php?id='.$courseid);
exit;
}
Expand Down Expand Up @@ -105,9 +102,7 @@
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
/*
email_to_user($user,$USER,get_string('courserejectsubject'),get_string('courserejectemail','moodle',$rejectnotice));
*/

$DB->delete_records("course_request", array("id"=>$reject->id));
notice(get_string('courserejected'),'pending.php');
}
Expand Down
41 changes: 0 additions & 41 deletions enrol/authorize/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ private function cc_submit($form, $course)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($paymentmanager, $USER, $emailsubject, $emailmessage);
*/
}
}
redirect($CFG->wwwroot, get_string("reviewnotify", "enrol_authorize"), '30');
Expand Down Expand Up @@ -290,15 +286,6 @@ private function cc_submit($form, $course)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user(
$paymentmanager,
$USER,
get_string("enrolmentnew", '', format_string($course->shortname)),
get_string('enrolmentnewuser', '', $a)
);
*/
}
if (!empty($CFG->enrol_mailadmins)) {
$a = new stdClass;
Expand All @@ -316,15 +303,6 @@ private function cc_submit($form, $course)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user(
$admin,
$USER,
get_string("enrolmentnew", '', format_string($course->shortname)),
get_string('enrolmentnewuser', '', $a)
);
*/
}
}
}
Expand Down Expand Up @@ -746,10 +724,6 @@ public function cron()
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($adminuser, $adminuser, "AUTHORIZE.NET CRON FAULTS", $faults);
*/
}
if (!empty($CFG->enrol_mailadmins)) {
$eventdata = new object();
Expand All @@ -762,9 +736,6 @@ public function cron()
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
/*
email_to_user($adminuser, $adminuser, "AUTHORIZE.NET CRON LOG", $this->log);
*/
}

// Send emails to students about which courses have enrolled.
Expand Down Expand Up @@ -833,10 +804,6 @@ private function cron_daily()
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
@email_to_user($csvuser, $adminuser, $subject, $message);
*/
}
mtrace(" users who have 'enrol/authorize:uploadcsv' were mailed");
}
Expand Down Expand Up @@ -882,10 +849,6 @@ private function cron_daily()
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($adminuser, $adminuser, $subject, $message);
*/

// Email to payment managers
if (empty($CFG->an_emailexpiredteacher)) {
return; // email feature disabled for teachers.
Expand Down Expand Up @@ -933,10 +896,6 @@ private function cron_daily()
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($paymentmanager, $adminuser, $subject, $message);
*/
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions enrol/authorize/localfuncs.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ function message_to_admin($subject, $data)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
/*
email_to_user($admin, $admin, "$SITE->fullname: Authorize.net ERROR", $message);
*/
}

function send_welcome_messages($orderdata)
Expand Down Expand Up @@ -202,10 +199,6 @@ function send_welcome_messages($orderdata)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
@email_to_user($user, $sender, get_string("enrolmentnew", '', $SITE->shortname), $emailmessage);
*/
}
}
while ($ei);
Expand Down
4 changes: 0 additions & 4 deletions enrol/authorize/uploadcsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ function authorize_process_csv($filename)
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin, $admin, "$SITE->fullname: Authorize.net CSV ERROR LOG", $ignoredlines);
*/
}

/// Send welcome messages to users
Expand Down
18 changes: 0 additions & 18 deletions enrol/flatfile/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname),
get_string('welcometocoursetext', '', $a));
*/
}

if (!empty($CFG->enrol_mailteachers) && $teachers) {
Expand All @@ -253,11 +248,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
*/
}
}
}
Expand Down Expand Up @@ -285,10 +275,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user(get_admin(), get_admin(), get_string("filelockedmailsubject", "enrol_flatfile"), get_string("filelockedmail", "enrol_flatfile", $filename));
*/
$this->log .= "Error unlinking file $filename\n";
}

Expand All @@ -303,10 +289,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user(get_admin(), get_admin(), "Flatfile Enrolment Log", $this->log);
*/
}

} // end of if(file_exists)
Expand Down
3 changes: 0 additions & 3 deletions enrol/imsenterprise/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ function cron() {
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user(get_admin(), get_admin(), "Moodle IMS Enterprise enrolment notification", $msg);
*/
$this->log_line('Notification email sent to administrator.');

}
Expand Down
8 changes: 0 additions & 8 deletions enrol/manual/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
/*
email_to_user($user, $teacher, format_string($SITE->fullname) .' '. $strexpirynotify,
$strexpirynotifystudentsemail);
*/
}
}
}
Expand All @@ -354,10 +350,6 @@ function cron() {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($teacher, $admin, $a->coursename .' '. $strexpirynotify, $strexpirynotifyemail);
*/
}
}
}
Expand Down
21 changes: 0 additions & 21 deletions enrol/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($user, get_admin(), "Moodle: PayPal payment", "Your PayPal payment is pending.");
*/
message_paypal_error_to_admin("Payment pending", $data);
die;
}
Expand Down Expand Up @@ -195,10 +192,6 @@
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($user, $teacher, get_string("enrolmentnew", '', $course->shortname),
get_string('welcometocoursetext', '', $a));
*/
}

if (!empty($CFG->enrol_mailteachers)) {
Expand All @@ -215,11 +208,6 @@
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($teacher, $user, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
*/
}

if (!empty($CFG->enrol_mailadmins)) {
Expand All @@ -237,11 +225,6 @@
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin, $user, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
*/
}
}

Expand Down Expand Up @@ -282,10 +265,6 @@ function message_paypal_error_to_admin($subject, $data) {
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($admin, $admin, "PAYPAL ERROR: ".$subject, $message);
*/
}

?>
8 changes: 2 additions & 6 deletions error/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
$eventdata->fullmessage = $form->text;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
$eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);

/*
email_to_user($supportuser, $USER, 'Error: '. $form->referer .' -> '. $form->requested, $form->text);
*/


redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3);
exit;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,11 @@ function create_admin_user($user_input=NULL) {
foreach ($adminroles as $adminrole) {
role_assign($adminrole->id, $user->id, 0, $sitecontext->id);
}

//set default message preferences
if (!message_set_default_message_preferences( $user )){
print_error('cannotsavemessageprefs', 'debug');
}

set_config('rolesactive', 1);

Expand Down
Loading

0 comments on commit 2044a2b

Please sign in to comment.