Skip to content
Browse files

Better log_display fixes

  • Loading branch information...
1 parent 14e4a49 commit db70b54b62e137838925d4c8b6a81acad52f7a00 moodler committed Jan 1, 2003
Showing with 32 additions and 4 deletions.
  1. +4 −2 lib/db/mysql.php
  2. +3 −1 lib/db/mysql.sql
  3. +20 −0 lib/db/postgres7.php
  4. +4 −0 lib/db/postgres7.sql
  5. +1 −1 version.php
View
6 lib/db/mysql.php
@@ -230,12 +230,12 @@ function main_upgrade($oldversion=0) {
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)') ");
}
}
- if ($oldversion < 2003010100) {
+ if ($oldversion < 2003010101) {
delete_records("log_display", "module", "user");
$new->module = "user";
$new->action = "view";
$new->mtable = "user";
- $new->field = "CONCAT(firstname,\' \',lastname)";
+ $new->field = "CONCAT(firstname,\" \",lastname)";
insert_record("log_display", $new);
delete_records("log_display", "module", "course");
@@ -246,6 +246,8 @@ function main_upgrade($oldversion=0) {
insert_record("log_display", $new);
$new->action = "update";
insert_record("log_display", $new);
+ $new->action = "enrol";
+ insert_record("log_display", $new);
}
return true;
View
4 lib/db/mysql.sql
@@ -227,6 +227,8 @@ CREATE TABLE `prefix_user_teachers` (
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per teacher per course';
-INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)');
+INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
+INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
+INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
View
20 lib/db/postgres7.php
@@ -19,6 +19,26 @@
function main_upgrade($oldversion=0) {
+ if ($oldversion < 2003010101) {
+ delete_records("log_display", "module", "user");
+ $new->module = "user";
+ $new->action = "view";
+ $new->mtable = "user";
+ $new->field = "CONCAT(firstname,\" \",lastname)";
+ insert_record("log_display", $new);
+
+ delete_records("log_display", "module", "course");
+ $new->module = "course";
+ $new->action = "view";
+ $new->mtable = "course";
+ $new->field = "fullname";
+ insert_record("log_display", $new);
+ $new->action = "update";
+ insert_record("log_display", $new);
+ $new->action = "enrol";
+ insert_record("log_display", $new);
+ }
+
return true;
}
View
4 lib/db/postgres7.sql
@@ -137,3 +137,7 @@ CREATE TABLE prefix_user_teachers (
INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
+INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
+INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
+INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
+INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
View
2 version.php
@@ -5,7 +5,7 @@
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
-$version = 2003010100; // The current version is a date (YYYYMMDDXX)
+$version = 2003010101; // The current version is a date (YYYYMMDDXX)
$release = "1.0.8 alpha"; // User-friendly version number

0 comments on commit db70b54

Please sign in to comment.
Something went wrong with that request. Please try again.