Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
You can also log in as if you wish to investigate things further ...
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
This would be essential in, say, a criminal investigation. Either way, if you prevent it then database admins would still be able to read it. If you encrypt it and the police need essential information then you're stuffed.
Anyway, since when has communication via the internet / network been private?
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
For example, a teacher woudn't be able to see the logs of a different class, nor would she have "loginas" rights for students who are not in her course's "participant list."
If there is a way, I'd love to know how so that I can let teachers know.
Thanks!
Tom
LATER EDIT.... Oh, you mean, if a student wrote an off-course comment, it would still be visible to any of his current teachers? Yeah, that's true. I guess at the k-12 level this kind of potential audit is really necessary and critical...
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
How do I "look" for message write in the log file?
It seems very tedious to manually search the logs for this if only 1 in 30 logged activities is a message write.
Is there a filter available for this?
Re: Messaging: What facilities are there for seeing users' messages?
Teachers have no special powers in this regard (should they?)
Re: Messaging: What facilities are there for seeing users' messages?
-- Art
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Being the admin of two sites that are for high school students, I believe it would be necessary for the teacher of that course to view these logs. With 2600 students it is important that teachers know what is going on "in" their classes and it is too much for the site admin to do.
Neil
Re: Messaging: What facilities are there for seeing users' messages?
I agree that it is too much to ask the admin to monitor student messages and teachers do need to know what is going on in their classes, but I don't think a teacher can see the content of messages from logs.
I'm the admin for a couple of public schools sites as well and we have decided to just disable the messaging feature...too big a liability to provide an unmonitored messaging system to public school students.
Steve
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
I agree with Hansen and Steve Hyndman had rightly disabled the feature. I do not know how many of you will agree with me on the following points. I'm probably too dumb to understand what additional facility this message service is providing. Everyone here using moodle purely for educational purpose and anything related to a particular course one always has a forum to discuss various points (all teachers of that course can really see) and there is always a site forum to discuss about everything else. I do not think any use of having private messaging service and eat the server resources. Students have various chat programme to do that sort of thing. This will also put less pressure on teacher and admin in monitoring security breaches or similar sort of thing.
I understand that the importance of this message service if moodle itself wants to transform itself into a comprehensive one pot general content management system with educational management as a part of it.
Re: Messaging: What facilities are there for seeing users' messages?
Perhaps the login as student feature could be modified at the instructor level so instructors are prohibited from viewing a students "messages" - but as an administrator we have had to have a peek into students and instructors messages from time to time to help provide technical assistance.
Re: Messaging: What facilities are there for seeing users' messages?
Hello,
I realize that this is 3 years after the initial posts, but feel compelled to reply in case someone else, like myself, is searching for answers to these types of questions, e.g., how do we control the use of the messaging system within Moodle.
I am in charge of an online program that provides supplementary courses for students enrolled in school districts within a rural geographic area in Oregon. One of the issues we face, which is actually faced by EVERY school, is which battles we want to fight. While I am not necessarily in favor of adding to my own workload or that of anyone else's, I believe we need to look at how the world does business before we make decisions regarding blocking communications technologies.
A recent study by the National School Boards Association found that "96 percent of students with online access use social networking technologies."
The new NETS standards for Students, published by ISTE in July, 2007, states that students need to learn to communicate and collaborate (among other things).
How can we prepare our students for THEIR futures if our knee-jerk response is always to block what's difficult or uncomfortable for us? At a workshop this spring, someone compared this practice to working with young students and teaching them to cross the street: We don't completely prevent them from crossing the street, but we begin by teaching them about the danger, then hold their hand when they cross the street, and after much practice, monitoring, and some maturity (?!), we allow them to cross the street independently. What we are currently doing with much of our educational technology problems, e.g. MySpace, chat, cellphones, etc., is ignoring the fact that students need to learn to cross the street/use technology safely by preventing them from doing so while they are still within the safe confines of school. This point of view is not uniquely mine; it is shared by well-known educational technology gurus as Marc Prensky and David Warlick, among others.
To me the question is: How can we help students learn to communicate effectively and responsibly?
Kudos to all who are helping us to explore ways of preparing our students for their futures.
Re: Messaging: What facilities are there for seeing users' messages?
1) I don't want to have to explain that I (I'm the administrator and teacher) can read anyone's messages.
2) My students can see who is online, and they can email that student, if needed.
3) I do include a "General" comments forum, which is where students can engage in back-and-forth discussions, with EVERYONE seeing what is being discussed.
4) Students can use other social networks for social discussions, not mine (I pay for my own server space).
By the way, I think that the messaging system is really cool, but not in my environment. So I think it is important that administrators be able to turn this switch on and off. Maybe this should be a setting that teachers can enable or disable?
Re: Messaging: What facilities are there for seeing users' messages?
SELECT distinctrow c.username,a.message, d.username
FROM moodlenew.mdl_message_read a
inner join moodlenew.mdl_message_read b on a.useridto = b.useridfrom
inner join moodlenew.mdl_user c on a.useridfrom=c.id
inner join moodlenew.mdl_user d on a.useridto=d.id
where a.timeread > unix_timestamp(date_add(curdate(),interval - 1 day))
Re: Messaging: What facilities are there for seeing users' messages?
Perhaps the easiest way to get to it is to create a link to it by "adding a resource" to a course of your choice (I have one for admin links) and choosing "link to a file or web site".
By default it displays every message that has ever been sent, showing when it was sent, the sender and recipient, and when/if it was read. If you hover the mouse over a user's name, it will show you when he/she last accessed Moodle, and if you click on the name it will bring up their profile page.
You can also restrict it to the last 'n' days by calling it with the parameter, days=n, e.g. /message/listall.php?days=14 to show the last two weeks' worth.
Finally, it respects the existing permissions, only producing output if the currently logged in user has the "moodle/site:readallmessages" capability. You can also hide your link to it from students by making it a hidden resource (click on the little eye thing when you're editing the page). That way, it will appear grey (but useable) to teachers and admins, but invisible to students.
Edit: You can separate the read/unread messages by reversing the ORDER BY statement so it reads ORDER BY 5 ASC, 1 DESC;
Here's the code. Paste it all into a file using Notepad or TextWranger, or whatever, and upload it to your Moodle. My suggested location is /message but anywhere should work, as long as it can still find config.php.
require_once('../config.php');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:readallmessages', $context);
$PAGE = page_create_object(PAGE_COURSE_VIEW, 1); // Complete hack - no idea how to use this function properly
$PAGE->print_header('View all messages'); // Should probably be PAGE_ADMIN but I can't get this to work
if ( isset($_GET['days']) ) {
$qualifierr = 'WHERE msgr.timecreated > UNIX_TIMESTAMP(DATE_ADD(CURDATE(),INTERVAL - 10 DAY))';
$qualifieru = 'WHERE msgu.timecreated > UNIX_TIMESTAMP(DATE_ADD(CURDATE(),INTERVAL - 10 DAY))';
} else {
$qualifierr = '';
$qualifieru = '';
}
// SQL based on a suggestion by Ian Cannonier, in this thread: http://moodle.org/mod/forum/discuss.php?d=27559
$query = <<< END_OF_SQL
SELECT FROM_UNIXTIME(timecreated), senderr.username, message, recipientr.username, FROM_UNIXTIME(timeread), senderr.id, recipientr.id, FROM_UNIXTIME(senderr.lastaccess), FROM_UNIXTIME(recipientr.lastaccess)
FROM {$CFG->prefix}message_read msgr
INNER JOIN {$CFG->prefix}user senderr ON msgr.useridfrom=senderr.id
INNER JOIN {$CFG->prefix}user recipientr ON msgr.useridto=recipientr.id
$qualifierr
UNION ALL
SELECT FROM_UNIXTIME(timecreated), senderu.username, message, recipientu.username, 'unread', senderu.id, recipientu.id, FROM_UNIXTIME(senderu.lastaccess), FROM_UNIXTIME(recipientu.lastaccess)
FROM {$CFG->prefix}message msgu
INNER JOIN {$CFG->prefix}user senderu ON msgu.useridfrom=senderu.id
INNER JOIN {$CFG->prefix}user recipientu ON msgu.useridto=recipientu.id
$qualifieru
ORDER BY 1 DESC, 5 ASC;
END_OF_SQL;
if ( ! $connection = mysql_connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass) ) {
print_error("Could not connect to MySQL database");
}
if ( ! mysql_select_db($CFG->dbname) ) {
print_error("Could not select database");
}
// print_header(''); // This seems to be unnecessary / pointless
if ( ! $result = mysql_query($query) ) {
echo "<p>No messages have been sent</p>\n\n";
} else {
echo "<table border=\"1\">\n";
echo " <tr><th>Sent</th><th>From</th><th>To</th><th>Read</th><th>Message</th></tr>\n";
while( $row = mysql_fetch_array($result) ) {
echo " <tr>\n";
echo " <td align=\"center\">". substr($row[0],0,10) .'<br>'. substr($row[0],11,8) ."</td>\n";
echo " <td align=\"center\" nowrap><a href=\"{$CFG->wwwroot}/user/view.php?id={$row[5]}\" title=\"last access: {$row[7]}\">{$row[1]}</a></td>\n";
echo " <td align=\"center\" nowrap><a href=\"{$CFG->wwwroot}/user/view.php?id={$row[6]}\" title=\"last access: {$row[8]}\">{$row[3]}</a></td>\n";
echo " <td align=\"center\">". substr($row[4],0,10) .'<br>'. substr($row[4],11,8) ."</td>\n";
echo " <td>". str_replace("\n","<br>\n", $row[2]) ."</td>\n";
echo " </tr>\n";
}
echo "</table>\n";
}
print_footer();
?>
Re: Messaging: What facilities are there for seeing users' messages?
Mike
Re: Messaging: What facilities are there for seeing users' messages?
I'm glad you found it useful.
Actually, your additions inspired me to give the whole thing a bit of an overhaul. In a nutshell, I've:
* incorporated your filters by sender, recipient, both or either
* fixed a bug to allow proper filtering by message age
* added the ability to sort results in various ways
* tidied the SQL generation code so there isn't so much duplication
* added a front end to the various options
I'm quite pleased with it but I haven't tested it extensively. Let me know what you think.
-Will.
EDIT: Filtering by user is now done by username so, for example, I might filter with 'joebloggs' instead of having to remember that Joe's user ID is 274.
* I've added a pair of links to each row to quickly allow you to re-filter to see all messages involving sender or recipient
* I've added a link at the top the quickly remove all filters
Latest version attached.
Re: Messaging: What facilities are there for seeing users' messages?

Mike
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Mike
Re: Messaging: What facilities are there for seeing users' messages?
I've been looking for a good messaging log report and this one does the trick quite well.
What do you think about setting this up as a report to drop into admin/report, and adding an export option of some sort?
It would be nice to see this in contrib.
Thanks,
Matt
Re: Messaging: What facilities are there for seeing users' messages?
As far as admin reports go, I haven't really played with them- might well be worth looking into at some point
Thanks,
Mike
Re: Messaging: What facilities are there for seeing users' messages?
Thanks,
Matt
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Always worked like a charm.
Since a recent server upgrade (php 5.2.9, MySQL 5.0.67 and apache 2.2.11) I'm getting an internal server error.
Any idea how to solve this?
Re: Messaging: What facilities are there for seeing users' messages?
Anyone got any idea what's going on?
Thanks,
Mike
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Thanks,
Mike
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
I tried to install this on a couple of sites, our test site and our main site.
On the test site 1.9.4 it went in fine with no problems. On the main site 1.9.2+ I get an error when I click on 'Message Logs' - which links to http://docs.moodle.org/en/error/admin/sectionerror.
The text of that page reads...
error/admin/sectionerror
The error means that a new admin page 'foo' (the one you're developing right now) is not registered with the Admin menu. It is triggered with the call:
admin_externalpage_setup('foo');
The solution is to add a reference to the page in the appropriate file in admin/settings/XXX.php. Something like:
$ADMIN->add("parent_section", new admin_externalpage('foo', "Foo Admin Component", "$CFG->wwwroot/$CFG->admin/foo.php"));
What am I missing??
Paul
Re: Messaging: What facilities are there for seeing users' messages?
Re: Messaging: What facilities are there for seeing users' messages?
Tim's post about this is at http://moodle.org/mod/forum/discuss.php?d=81452 - basically, you need to add a string for the message log report to /lang/en_utf8/admin.php - something like:
$string["messagelog"] = 'Message Log';
This should be all you need to do to correct it - but let me know, and I'll keep digging if it doesn't fix it for you.
Thanks,
Matt
Re: Messaging: What facilities are there for seeing users' messages?
Thanks,
Matt