Skip to content

Commit

Permalink
Adding propper support for the forum->user report log action. It was
Browse files Browse the repository at this point in the history
a bit wrong. Code credits go to Petr!
  • Loading branch information
stronk7 committed Jun 1, 2006
1 parent bf48c7a commit de78b7e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mod/forum/db/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ function forum_upgrade($oldversion) {
table_column('forum_posts','','mailnow','integer');
}

if ($oldversion < 2006011702) {
execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('forum', 'user report', 'user', 'CONCAT(firstname,\' \',lastname)')");
}

return true;

}
Expand Down
1 change: 1 addition & 0 deletions mod/forum/db/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum',
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'add post', 'forum_posts', 'subject');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'update post', 'forum_posts', 'subject');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'user report', 'user', 'CONCAT(firstname,\' \',lastname)');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'move discussion', 'forum_discussions', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'view subscribers', 'forum', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
Expand Down
4 changes: 4 additions & 0 deletions mod/forum/db/postgres7.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ function forum_upgrade($oldversion) {
execute_sql("ALTER TABLE {$CFG->prefix}forum DROP CONSTRAINT {$CFG->prefix}forum_type_check");
}

if ($oldversion < 2006011702) {
execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('forum', 'user report', 'user', 'firstname||\' \'||lastname')");
}


return true;

Expand Down
1 change: 1 addition & 0 deletions mod/forum/db/postgres7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum',
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'add post', 'forum_posts', 'subject');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'update post', 'forum_posts', 'subject');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'user report', 'user', 'firstname||\' \'||lastname');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'move discussion', 'forum_discussions', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'view subscribers', 'forum', 'name');
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
require_course_login($course);


add_to_log($course->id, "forum", "user report", "user.php?id=$course->id&amp;user=$user->id&amp;mode=$mode", "$user->id");
add_to_log($course->id, "forum", "user report", "user.php?course=$course->id&amp;id=$user->id&amp;mode=$mode", "$user->id");

$strforumposts = get_string('forumposts', 'forum');
$strparticipants = get_string('participants');
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////

$module->version = 2006011701;
$module->version = 2006011702;
$module->requires = 2005031000; // Requires this Moodle version
$module->cron = 60;

Expand Down

0 comments on commit de78b7e

Please sign in to comment.