[Moodle] Messaging System Hack

Kevork Krozian Kroset at novell1.fhc.vic.edu.au
Wed Jul 12 12:25:20 EST 2006


Hi Stephen,

 This is fabulous work you are doing and your rationale is always considered and thoughtful.
Thanks for sharing all this. 

Best Wishes



Kevork Krozian
IT Manager , Forest Hill College
k.krozian at fhc.vic.edu.au
http://www.fhc.vic.edu.au
Mobile: 0419 356 034

>>> digby.stephen.p at edumail.vic.gov.au 07/11/06 12:55pm >>>
*	

	As explained in previous posts, I do NOT want the school to provide
knowledge to students of each others email accounts (otherwise, we may be
liable to fix the harassment etc. that then occurs outside school using this
info).
*	

	As teachers cannot change their email accounts without disrupting
their professional communication, I do not want staff emails publicly
available OR available to students.
*	

	Because I do not want to be responsible for the email traffic that
goes on outside school purposes, AND because I do not want to complicate
students and staff lives with additional email addresses, I do not want to
provide an additional school based email address and server
*	

	I do NOT want to add an extra admin burden to staff (e.g. please
check another email address, or please check your online messages OR please
check your voice mail).  I want ALL communication in school to be funneled
through EITHER email OR physical pigeon hole - i.e. expectations are that
teachers MUST check their email AND their pigeon hole ONCE A DAY
*	

	BUT I DO want to allow staff to contact students and vice versa, AND
I do want to allow students to contact each other.
*	

	Moodle messaging has proved the answer to all these...

*	

	 with a very small simple hack...
*	

	AND the message "black-white" list enhancement download from
moodle.org

I have changed the moodle/ message/ lib.php so that when a message is send
in the school, a cc is automatically sent to the users email address as
well.
I have sent a message to all school users:
  _____  

Dear Moodle Users
 
The school message system allows students to contact staff; staff to contact
students; staff to contact staff and parents to contact staff.
IF students provide a functional email address in their online profile, then
any moodle messages will be sent to them by email.  If NOT, they can check
their messages online (see below).
Staff do NOT need to check moodle for messages as all messages are sent by
email.
The system does not reveal the email addresses of either the sender or the
receiver.
All past sent and received messages can be viewed online until the end of
each term, when they are archived.
Abuse of the messaging system will result in student being BLOCKED as a
sender.  They will still receive emails from teachers, but not students.
Inappropriate messages can all be traced, and appropriate action will be
taken. (e.g. blocking use, detention, suspension, expulsion, civil or
criminal prosecution)
 
To send an email to a teacher or a student:

*	click on your name (at the top right of most moodle screens)
*	click on the "Messages"
*	find the student or teachers
*	click on their name
*	write the message
*	send
*	wait until the message is displayed in the send section above before
closing the window.

To reply to an email, repeat the above process.
NOTE: Clicking REPLY to the email will NOT successfully send a message back
because you have not been told the email address of the sender.
 
To check messages that have been sent or received:


*	click on your name (at the top right of most moodle screens)
*	click on the "Messages".  The names of people who have sent you
messages is displayed
*	click on the name of the sender, to see the messages.

 
  _____  

///commented out the lines that check the users preferences and the online
status so that all messages get sent by email immediately

/// Check to see if anything else needs to be done with it

    $preference = (object)get_user_preferences(NULL, NULL, $userto->id);

///    if (!empty($preference->message_emailmessages)) {  // Receiver wants
mail forwarding    Commented out by DIG to force all message to be emailed
///        if ((time() - $userto->lastaccess) >
((int)$preference->message_emailtimenosee * 60)) { //     
            $message = stripslashes_safe($message);
            $tagline = get_string('emailtagline', 'message',
$SITE->shortname);

            $messagesubject = message_shorten_message(strip_tags($message),
30).'...';

            $messagetext = format_text_email($message, $format).
 
"\n\n--\n".$tagline."\n"."$CFG->wwwroot/message/index.php?popup=1";

            if ($preference->message_emailformat == FORMAT_HTML) {
                $messagehtml  = format_text($message, $format);
                $messagehtml .= '<hr /><p><a
href="'.$CFG->wwwroot.'/message/index.php?popup=1">'.$tagline.'</a></p>';
            } else {
                $messagehtml = NULL;
            }

            $userto->email = $preference->message_emailaddress;   // Use
custom messaging address
            email_to_user($userto, $userfrom, $messagesubject, $messagetext,
$messagehtml);
 ///       }  ommented out by DIG to force all message to be emailed
 ///   }   Commented out by DIG to force all message to be emailed

    return $savemessage->id;


Important -
This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education & Training..



More information about the moodle mailing list