From e11b8b160ccabf19ff15c4a4abcf3425e8b08bb6 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Tue, 31 Jan 2012 11:31:23 +0530 Subject: [PATCH] MDL-27891 Tags Flagging tags is now logged --- lib/db/log.php | 1 + tag/user.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/db/log.php b/lib/db/log.php index 2bb3222a214..4814f7d41c9 100644 --- a/lib/db/log.php +++ b/lib/db/log.php @@ -48,4 +48,5 @@ $logs = array( array('module'=>'message', 'action'=>'unblock contact', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), array('module'=>'group', 'action'=>'view', 'mtable'=>'groups', 'field'=>'name'), array('module'=>'tag', 'action'=>'update', 'mtable'=>'tag', 'field'=>'name'), + array('module'=>'tag', 'action'=>'flag', 'mtable'=>'tag', 'field'=>'name'), ); diff --git a/tag/user.php b/tag/user.php index 20d21b20e38..82b456ac615 100644 --- a/tag/user.php +++ b/tag/user.php @@ -45,7 +45,11 @@ switch ($action) { case 'flaginappropriate': - tag_set_flag(tag_get_id($tag)); + $tagid = tag_get_id($tag); + // Add flaging action to logs + add_to_log(SITEID, 'tag', 'flag', 'index.php?id='. $tagid, $tagid, '', $USER->id); + + tag_set_flag($tagid); redirect($CFG->wwwroot.'/tag/index.php?tag='. rawurlencode($tag), get_string('responsiblewillbenotified', 'tag')); break;