Permalink
Browse files

Fixes to logging and log display

  • Loading branch information...
1 parent 498178e commit d7d1f618e8a6923c7874d111cc233697f6409529 martin committed Jul 31, 2002
Showing with 19 additions and 5 deletions.
  1. +5 −2 mod/forum/db/mysql.sql
  2. +7 −1 mod/forum/mod.php
  3. +1 −1 mod/forum/search.php
  4. +6 −1 mod/forum/version.php
View
@@ -83,10 +83,13 @@ CREATE TABLE forum_subscriptions (
#
INSERT INTO log_display VALUES ('forum', 'add', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'add discussion', 'forum_discuss', 'name');
+INSERT INTO log_display VALUES ('forum', 'update', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
INSERT INTO log_display VALUES ('forum', 'add post', 'forum_posts', 'subject');
INSERT INTO log_display VALUES ('forum', 'update post', 'forum_posts', 'subject');
-INSERT INTO log_display VALUES ('forum', 'view discussion', 'forum_discuss', 'name');
+INSERT INTO log_display VALUES ('forum', 'view subscribers', 'forum', 'name');
+INSERT INTO log_display VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
INSERT INTO log_display VALUES ('forum', 'view forum', 'forum', 'name');
INSERT INTO log_display VALUES ('forum', 'subscribe', 'forum', 'name');
INSERT INTO log_display VALUES ('forum', 'unsubscribe', 'forum', 'name');
+
View
@@ -36,6 +36,7 @@ function add_instance($forum) {
error("Could not add the discussion for this forum");
}
}
+ add_to_log($forum->course, "forum", "add", "index.php?f=$forum->id", "$forum->id");
return $forum->id;
}
@@ -77,7 +78,12 @@ function update_instance($forum) {
}
}
- return update_record("forum", $forum);
+ if (update_record("forum", $forum)) {
+ add_to_log($forum->course, "forum", "update", "index.php?f=$forum->id", "$forum->id");
+ return true;
+ } else {
+ return false;
+ }
}
View
@@ -14,7 +14,7 @@
require_login($course->id);
- add_to_log($course->id, "course", "search", "search.php?id=$course->id&search=$search", "$search");
+ add_to_log($course->id, "forum", "search", "search.php?id=$course->id&search=$search", "$search");
if ($search) {
print_header("$course->shortname: Search Results", "$course->fullname",
View
@@ -6,7 +6,7 @@
////////////////////////////////////////////////////////////////////////////////
$module->fullname = "Forum";
-$module->version = 2002073008;
+$module->version = 2002080100;
$module->cron = 60;
$module->search = "";
@@ -36,6 +36,11 @@ function forum_upgrade($oldversion) {
notify("Renamed all the old discuss tables (now part of forum) and created new forum_types");
}
+ if ($oldversion < 2002080100) {
+ execute_sql("INSERT INTO log_display VALUES ('forum', 'view subscribers', 'forum', 'name') ");
+ execute_sql("INSERT INTO log_display VALUES ('forum', 'update', 'forum', 'name') ");
+ }
+
return true;
}

0 comments on commit d7d1f61

Please sign in to comment.