]> git.mjollnir.org Git - moodle.git/commitdiff
Changes to log view page so that infected files comes under 'site errors'.
authormjollnir_ <mjollnir_>
Fri, 17 Sep 2004 00:10:53 +0000 (00:10 +0000)
committermjollnir_ <mjollnir_>
Fri, 17 Sep 2004 00:10:53 +0000 (00:10 +0000)
These patches are maintained in an publicly accessible Arch repository, see: http://lists.eduforge.org/cgi-bin/archzoom.cgi/arch-eduforge@catalyst.net.nz--2004-MIRROR/moodle--eduforge--1.3.3

Index of arch patches in this commit:

arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-73
    2004-09-17 00:05:28 GMT
    Penny Leach <penny@catalyst.net.nz>
    better logging for uploads and infected files, as well as changing the log page view slightly so that site errors yields infected files as well

Full logs:

Revision: moodle--eduforge--1.3.3--patch-73
Archive: arch-eduforge@catalyst.net.nz--2004
Creator: Penny Leach <penny@catalyst.net.nz>
Date: Fri Sep 17 12:05:28 NZST 2004
Standard-date: 2004-09-17 00:05:28 GMT
Modified-files: course/lib.php lib/uploadlib.php
    lib/weblib.php
New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-73
Summary: better logging for uploads and infected files, as well as changing the log page view slightly so that site errors yields infected files as well
Keywords:

course/lib.php
lib/uploadlib.php
lib/weblib.php

index 173c8568044c2bcfebba66544926d2db738df10e..523189e32e492f66851183b9ada611caebb54617 100644 (file)
@@ -320,16 +320,15 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
                 $selectedactivity = "$mod->cm";
             }
         }
+    }
 
-        if (isadmin() && !$course->category) {
-            $activities["site_errors"] = get_string("siteerrors");
-            if ($modid === "site_errors") {
+    if (isadmin() && !$course->category) {
+        $activities["site_errors"] = get_string("siteerrors");
+        if ($modid === "site_errors") {
             $selectedactivity = "site_errors";
-            }
         }
     }
 
-
     $strftimedate = get_string("strftimedate");
     $strftimedaydate = get_string("strftimedaydate");
 
@@ -398,6 +397,9 @@ function make_log_url($module, $url) {
         case "admin":
             return "/$module/$url";
             break;
+        case "upload":
+            return "$url";
+            break;
         case "library":
         case "":
             return "/";
@@ -448,7 +450,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
     }
 
     if ('site_errors' === $modid) {
-        $joins[] = "l.action='error'";
+        $joins[] = "l.action='error' OR l.action='infected'";
     } else if ($modid) {
         $joins[] = "l.cmid = '$modid'";
     }
index f08fc807faf858462f672779e9c4c6b8a4debdf8..6463abd9b26e43e1a12aa954ccde2348712d7885 100644 (file)
@@ -607,7 +607,7 @@ function clam_log_upload($newfilepath,$course=null) {
     if ($course) {
         $courseid = $course->id;
     }
-    add_to_log($courseid,"upload","upload","",$newfilepath);
+    add_to_log($courseid,"upload","upload",$_SERVER['HTTP_REFERER'],$newfilepath);
 }
 
 /**
@@ -618,7 +618,7 @@ function clam_log_upload($newfilepath,$course=null) {
  */
 function clam_log_infected($oldfilepath='',$newfilepath='',$userid=0) {
 
-    add_to_log(0,"upload","infected","",$oldfilepath,0,$userid);
+    add_to_log(0,"upload","infected",$_SERVER['HTTP_REFERER'],$oldfilepath,0,$userid);
     
     $user = get_record('user','id',$userid);
     
index ab07ea10b78e483b08dbf2d1d737bfce4065be5b..09aa1470e476140707844928deda303f31ef5df4 100644 (file)
@@ -336,6 +336,10 @@ function link_to_popup_window ($url, $name="popup", $linkname="click here",
     }
     $fullscreen = 0;
 
+    if (!(strpos($url,$CFG->wwwroot) === false)) { // some log url entries contain _SERVER[HTTP_REFERRER] in which case wwwroot is already there.
+        $url = substr($url,strlen($CFG->wwwroot)+1);
+    }
+
     $link = "<a target=\"$name\" title=\"$title\" href=\"$CFG->wwwroot$url\" ".
            "onclick=\"return openpopup('$url', '$name', '$options', $fullscreen);\">$linkname</a>\n";
     if ($return) {