Skip to content

Commit 18b8fbf

Browse files
author
mjollnir_
committed
Centralised file upload code, integration with clam AV, integration with some modules: assignment, exercise, forum, glossaryt, resource, scorm (more to come soon).
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-15 final touches to sears stuff until testing can begin, beginning of magical uploadey wrappery function goodness arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-18 Virus scanning on upload arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-19 made emacs use spaces instead of tabs and fixed lib/moodlelib.php where it was bad in the new functions; few wording changes, added in support for clamdscan arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-20 handlevirus.php = new script to handle output of clamscan (designed for cron clamscan), changes to strings for emailing out virus notifications, changes to moodlelib - slightly different notice reporting in handle_infected_file and new function for replacing file with message arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-21 refactor to filter out invalid lines in input to handlevirus arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-22 modified assignment to use hande_file_upload arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-25 bug fix for handle_file_upload arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-26 Small fix for non thinking brain doing something silly arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-35 small fix to switch order of items in drop down to allow sensible defaults arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-36 small changes to strings file arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-38 taken stuff out of moodlelib to put in upload class arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-39 new upload class -in a changeset by itself just in case - not quite finished arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-40 tweaks to upload class - clam_scan_file can now take a path as an argument, not just an entry from _FILES, there is better handling of failure and notification, more allowance for module writers to keep control in general. Also slightly nicer strings entries for a few things arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-41 upload class integration with assignment module, bug fix, slight tweak arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-42 small changes to uploadlib, integration with assessment and assignment arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-44 tweaks for assessment and assignment for uploading arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-48 integration with exercise module arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-49 integration of virus stuff with forum module arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-50 integration of upload class and glossary module arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-51 just in case glossary_move_attachments is ever used, we change the log entries before we move the files. also moved clam_log_upload out of the class arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-52 virus scanning for imports for glossary arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-53 relog entries when moving files attached to forum posts arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-54 resource module integration with virus scanning arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-55 scorm integration with upload/virus class arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-56 fix for handlevirus.php since upload class changes Full logs: Revision: moodle--eduforge--1.3.3--patch-15 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Wed Sep 1 17:28:13 NZST 2004 Standard-date: 2004-09-01 05:28:13 GMT Modified-files: lang/en/moodle.php lib/moodlelib.php mod/assessment/sears.php mod/assessment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-15 Summary: final touches to sears stuff until testing can begin, beginning of magical uploadey wrappery function goodness Keywords: Revision: moodle--eduforge--1.3.3--patch-18 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Thu Sep 2 15:49:54 NZST 2004 Standard-date: 2004-09-02 03:49:54 GMT Modified-files: admin/config.html lang/en/moodle.php lib/moodlelib.php mod/assessment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-18 Summary: Virus scanning on upload Keywords: Revision: moodle--eduforge--1.3.3--patch-19 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Thu Sep 2 17:06:14 NZST 2004 Standard-date: 2004-09-02 05:06:14 GMT Modified-files: lang/en/moodle.php lib/moodlelib.php mod/assessment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-19 Summary: made emacs use spaces instead of tabs and fixed lib/moodlelib.php where it was bad in the new functions; few wording changes, added in support for clamdscan Keywords: Revision: moodle--eduforge--1.3.3--patch-20 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 3 16:06:05 NZST 2004 Standard-date: 2004-09-03 04:06:05 GMT New-files: admin/.arch-ids/handlevirus.php.id admin/handlevirus.php Modified-files: lang/en/moodle.php lib/moodlelib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-20 Summary: handlevirus.php = new script to handle output of clamscan (designed for cron clamscan), changes to strings for emailing out virus notifications, changes to moodlelib - slightly different notice reporting in handle_infected_file and new function for replacing file with message Keywords: Revision: moodle--eduforge--1.3.3--patch-21 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 6 11:37:31 NZST 2004 Standard-date: 2004-09-05 23:37:31 GMT Modified-files: admin/handlevirus.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-21 Summary: refactor to filter out invalid lines in input to handlevirus Keywords: Revision: moodle--eduforge--1.3.3--patch-22 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 6 13:07:48 NZST 2004 Standard-date: 2004-09-06 01:07:48 GMT Modified-files: mod/assignment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-22 Summary: modified assignment to use hande_file_upload Keywords: Revision: moodle--eduforge--1.3.3--patch-25 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 6 16:32:11 NZST 2004 Standard-date: 2004-09-06 04:32:11 GMT Modified-files: lib/moodlelib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-25 Summary: bug fix for handle_file_upload Keywords: Revision: moodle--eduforge--1.3.3--patch-26 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 6 16:51:50 NZST 2004 Standard-date: 2004-09-06 04:51:50 GMT Modified-files: lib/moodlelib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-26 Summary: Small fix for non thinking brain doing something silly Keywords: Revision: moodle--eduforge--1.3.3--patch-35 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 10:09:53 NZST 2004 Standard-date: 2004-09-09 22:09:53 GMT Modified-files: admin/config.html New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-35 Summary: small fix to switch order of items in drop down to allow sensible defaults Keywords: Revision: moodle--eduforge--1.3.3--patch-36 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 10:11:29 NZST 2004 Standard-date: 2004-09-09 22:11:29 GMT Modified-files: lang/en/moodle.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-36 Summary: small changes to strings file Keywords: Revision: moodle--eduforge--1.3.3--patch-38 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 10:17:24 NZST 2004 Standard-date: 2004-09-09 22:17:24 GMT Modified-files: lib/moodlelib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-38 Summary: taken stuff out of moodlelib to put in upload class Keywords: Revision: moodle--eduforge--1.3.3--patch-39 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 10:21:21 NZST 2004 Standard-date: 2004-09-09 22:21:21 GMT New-files: lib/.arch-ids/uploadlib.php.id lib/uploadlib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-39 Summary: new upload class -in a changeset by itself just in case - not quite finished Keywords: Revision: moodle--eduforge--1.3.3--patch-40 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 11:58:24 NZST 2004 Standard-date: 2004-09-09 23:58:24 GMT Modified-files: lang/en/moodle.php lib/uploadlib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-40 Summary: tweaks to upload class - clam_scan_file can now take a path as an argument, not just an entry from _FILES, there is better handling of failure and notification, more allowance for module writers to keep control in general. Also slightly nicer strings entries for a few things Keywords: Revision: moodle--eduforge--1.3.3--patch-41 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 12:38:02 NZST 2004 Standard-date: 2004-09-10 00:38:02 GMT Modified-files: lib/uploadlib.php mod/assignment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-41 Summary: upload class integration with assignment module, bug fix, slight tweak Keywords: Revision: moodle--eduforge--1.3.3--patch-42 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 15:30:20 NZST 2004 Standard-date: 2004-09-10 03:30:20 GMT Modified-files: lib/uploadlib.php mod/assessment/upload.php mod/assessment/view.php mod/assignment/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-42 Summary: small changes to uploadlib, integration with assessment and assignment Keywords: Revision: moodle--eduforge--1.3.3--patch-44 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Fri Sep 10 16:54:40 NZST 2004 Standard-date: 2004-09-10 04:54:40 GMT Modified-files: mod/assessment/lib.php mod/assignment/lib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-44 Summary: tweaks for assessment and assignment for uploading Keywords: Revision: moodle--eduforge--1.3.3--patch-48 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 09:57:03 NZST 2004 Standard-date: 2004-09-12 21:57:03 GMT Modified-files: lang/en/moodle.php mod/exercise/locallib.php mod/exercise/upload.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-48 Summary: integration with exercise module Keywords: Revision: moodle--eduforge--1.3.3--patch-49 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 11:35:46 NZST 2004 Standard-date: 2004-09-12 23:35:46 GMT Modified-files: mod/forum/lib.php mod/forum/post.html New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-49 Summary: integration of virus stuff with forum module Keywords: Revision: moodle--eduforge--1.3.3--patch-50 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 14:00:29 NZST 2004 Standard-date: 2004-09-13 02:00:29 GMT Modified-files: lang/en/glossary.php mod/glossary/edit.html mod/glossary/edit.php mod/glossary/lib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-50 Summary: integration of upload class and glossary module Keywords: Revision: moodle--eduforge--1.3.3--patch-51 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 15:13:02 NZST 2004 Standard-date: 2004-09-13 03:13:02 GMT Modified-files: lib/uploadlib.php mod/glossary/lib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-51 Summary: just in case glossary_move_attachments is ever used, we change the log entries before we move the files. also moved clam_log_upload out of the class Keywords: Revision: moodle--eduforge--1.3.3--patch-52 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 15:26:56 NZST 2004 Standard-date: 2004-09-13 03:26:56 GMT Modified-files: mod/glossary/import.html mod/glossary/import.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-52 Summary: virus scanning for imports for glossary Keywords: Revision: moodle--eduforge--1.3.3--patch-53 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 16:02:22 NZST 2004 Standard-date: 2004-09-13 04:02:22 GMT Modified-files: mod/forum/lib.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-53 Summary: relog entries when moving files attached to forum posts Keywords: Revision: moodle--eduforge--1.3.3--patch-54 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Mon Sep 13 16:58:37 NZST 2004 Standard-date: 2004-09-13 04:58:37 GMT Modified-files: mod/resource/coursefiles.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-54 Summary: resource module integration with virus scanning Keywords: Revision: moodle--eduforge--1.3.3--patch-55 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Tue Sep 14 16:15:47 NZST 2004 Standard-date: 2004-09-14 04:15:47 GMT Modified-files: mod/scorm/coursefiles.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-55 Summary: scorm integration with upload/virus class Keywords: Revision: moodle--eduforge--1.3.3--patch-56 Archive: arch-eduforge@catalyst.net.nz--2004 Creator: Penny Leach <penny@catalyst.net.nz> Date: Wed Sep 15 10:33:23 NZST 2004 Standard-date: 2004-09-14 22:33:23 GMT Modified-files: admin/handlevirus.php New-patches: arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-56 Summary: fix for handlevirus.php since upload class changes Keywords:
1 parent e0b7b09 commit 18b8fbf

File tree

18 files changed

+906
-233
lines changed

18 files changed

+906
-233
lines changed

admin/config.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,40 @@
476476
<?php print_string("configmaxbytes") ?>
477477
</td>
478478
</tr>
479+
<tr valign=top>
480+
<td align=right><p>runclamonupload:</p></td>
481+
<td>
482+
<?php
483+
unset($options);
484+
$options[0] = get_string("no");
485+
$options[1] = get_string("yes");
486+
487+
choose_from_menu($options,"runclamonupload",$config->runclamonupload,"","","");
488+
?>
489+
</td>
490+
<td><?php print_string("configrunclamonupload") ?></td>
491+
</tr>
492+
<tr valign=top>
493+
<td align=right><p>pathtoclam:</p></td>
494+
<td><input type="text" name="pathtoclam" size="30" value="<?php echo $config->pathtoclam ?>" /></td>
495+
<td><?php print_string("configpathtoclam") ?></td>
496+
</tr>
497+
<tr valign=top>
498+
<td align=right><p>quarantinedir:</p></td>
499+
<td><input type="text" name="quarantinedir" size="30" value="<?php echo $config->quarantinedir ?>" /></td>
500+
<td><?php print_string("configquarantinedir") ?></td>
501+
</tr>
502+
<tr valign=top>
503+
<td align=right><p>clamfailureonupload</p></td>
504+
<td><?php
505+
unset($options);
506+
$options['donothing'] = get_string('configclamdonothing');
507+
$options['actlikevirus'] = get_string('configclamactlikevirus');
508+
509+
choose_from_menu($options,"clamfailureonupload",$config->clamfailureonupload,"","","");
510+
?></td>
511+
<td><?php print_string("configclamfailureonupload"); ?></td>
512+
</tr>
479513
<tr valign="top">
480514
<td align="right"><p>fullnamedisplay:</td>
481515
<td>

admin/handlevirus.php

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?
2+
/** This expects the output from a command like
3+
* clamscan -r --infected --no-summary <files> 2>&1 | php thisfile.php
4+
* also it's important that the output of clamscan prints the FULL PATH to each infected file, so use absolute paths for area to scan
5+
*/
6+
7+
8+
$fd = fopen('php://stdin','r');
9+
if (!$fd) {
10+
exit();
11+
}
12+
13+
$FULLME='cron';
14+
require_once(dirname(dirname(__FILE__)).'/config.php');
15+
require_once($CFG->dirroot.'/lib/uploadlib.php'); // contains virus handling stuff.
16+
17+
$site = get_site();
18+
19+
while(!feof($fd)) {
20+
$entry = fgets($fd);
21+
if (strlen(trim($entry)) == 0) {
22+
continue;
23+
}
24+
if (!$file = validate_line($entry)) {
25+
continue;
26+
}
27+
$bits = explode('/',$file);
28+
$a->filename = $bits[count($bits)-1];
29+
30+
if (!$log = get_record("log","module","upload","info",$file)) {
31+
$a->action = clam_handle_infected_file($file,0,false);
32+
clam_replace_infected_file($file);
33+
notify_admins_unknown($file,$a);
34+
continue;
35+
}
36+
$action = clam_handle_infected_file($file,$log->userid,true);
37+
clam_replace_infected_file($file);
38+
39+
$user = get_record("user","id",$log->userid);
40+
$course = get_record("course","id",$log->course);
41+
$subject = get_string('virusfoundsubject','moodle',$site->fullname);
42+
$a->date = userdate($log->time);
43+
44+
$a->action = $action;
45+
$a->course = $course->fullname;
46+
$a->user = $user->firstname.' '.$user->lastname;
47+
48+
notify_user($user,$subject,$a);
49+
notify_admins($user,$subject,$a);
50+
}
51+
fclose($fd);
52+
53+
54+
function notify_user($user,$subject,$a) {
55+
56+
if (!$user) {
57+
return false;
58+
}
59+
$body = get_string('virusfoundlater','moodle',$a);
60+
email_to_user($user,get_admin(),$subject,$body);
61+
}
62+
63+
64+
function notify_admins($user,$subject,$a) {
65+
66+
$admins = get_admins();
67+
68+
$body = get_string('virusfoundlateradmin','moodle',$a);
69+
foreach ($admins as $admin) {
70+
email_to_user($admin,$admin,$subject,$body);
71+
}
72+
}
73+
74+
function notify_admins_unknown($file,$a) {
75+
76+
global $site;
77+
78+
$admins = get_admins();
79+
$subject = get_string('virusfoundsubject','moodle',$site->fullname);
80+
$body = get_string('virusfoundlateradminnolog','moodle',$a);
81+
foreach ($admins as $admin) {
82+
email_to_user($admin,$admin,$subject,$body);
83+
}
84+
}
85+
86+
function validate_line($line) {
87+
if (strpos($line,"FOUND") === false) {
88+
return false;
89+
}
90+
$index = strpos($line,":");
91+
$file = substr($line,0,$index);
92+
$file = preg_replace('/\/\//','/',$file);
93+
if (!file_exists($file)) {
94+
return false;
95+
}
96+
return $file;
97+
}
98+
99+
?>

lang/en/glossary.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
$string['entryexported'] = 'Entry succesfully exported';
8686
$string['entryishidden'] = '(this entry is currently hidden)';
8787
$string['entryleveldefaultsettings'] = 'Entry Level Default Settings';
88+
$string['entrysaved'] = 'This entry has been saved';
89+
$string['entryupdated'] = 'This entry has been updated';
8890
$string['entryusedynalink'] = 'This entry should be automatically linked';
8991
$string['explainaddentry'] = 'Add a new entry to the current glossary.<br />Concept and definition are mandatory fields.';
9092
$string['explainall'] = 'Shows ALL entries on one page';

lang/en/moodle.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@
143143
$string['choosetheme'] = 'Choose theme';
144144
$string['chooseuser'] = 'Choose a user';
145145
$string['city'] = 'City/town';
146+
$string['clambroken'] = 'Your administrator has enabled virus checking for file uploads but has misconfigured something.<br />Your file upload was NOT successful. Your administrator has been emailed to notify them so they can fix it.';
147+
$string['clamdeletedfile'] = 'The file has been deleted';
148+
$string['clamdeletedfilefailed'] ='The file could not be deleted';
149+
$string['clamemailsubject'] = '$a :: Clam AV notification';
150+
$string['clamfailed'] = 'Clam AV has failed to run. The return error message was $a. Here is the output from Clam:';
151+
$string['clamlost'] = 'Moodle is configured to run clam on file upload, but the path supplied to Clam AV, $a, is invalid.';
152+
$string['clamlostandactinglikevirus'] = 'In addition, moodle is configured so that if clam fails to run, files are treated like viruses. This essentially means that no student can upload a file successfully until you fix this.';
153+
$string['clammovedfile'] = 'The file has been moved to your specified quarantine directory, the new location is $a';
154+
$string['clammovedfilebasic'] = 'The file has been moved to a quarantine directory.';
155+
$string['clamquarantinedirfailed'] = 'Could not move the file into your specified quarantine directory, $a. You need to fix this as files are being deleted if they\'re found to be infected.';
156+
$string['clamunknownerror'] = 'There was an unknown error with clam.';
146157
$string['cleaningtempdata'] = 'Cleaning temp data';
147158
$string['clicktochange'] = 'Click to change';
148159
$string['closewindow'] = 'Close this window';
@@ -152,6 +163,9 @@
152163
$string['configallusersaresitestudents'] = 'For activities on the front page of the site, should ALL users be considered as students? If you answer \"Yes\", then any confirmed user account will be allowed to participate as a student in those activities. If you answer \"No\", then only users who are already a participant in at least one course will be able to take part in those front page activities. Only admins and specially assigned teachers can act as teachers for these front page activities.';
153164
$string['configautologinguests'] = 'Should visitors be logged in as guests automatically when entering courses with guest access?';
154165
$string['configcachetext'] = 'For larger sites or sites that use text filters, this setting can really speed things up. Copies of texts will be retained in their processed form for the time specified here. Setting this too small may actually slow things down slightly, but setting it too large may mean texts take too long to refresh (with new links, for example).';
166+
$string['configclamactlikevirus'] = 'Treat files like viruses';
167+
$string['configclamdonothing'] = 'Treat files as OK';
168+
$string['configclamfailureonupload'] = 'If you have configured clam to scan uploaded files, but it is configured incorrectly or fails to run for some unknown reason, how should it behave? If you choose \'Treat files like viruses\', they\'ll be moved into the quarantine area, or deleted. If you choose \'Treat files as OK\', the files will be moved to the desination directory like normal. Either way, admins will be alerted that clam has failed. If you choose \'Treat files like viruses\' and for some reason clam fails to run (usually because you have entered an invalid pathtoclam), ALL files that are uploaded will be moved to the given quarantine area, or deleted. Be careful with this setting.';
155169
$string['configcountry'] = 'If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.';
156170
$string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.';
157171
$string['configdeleteunconfirmed'] = 'If you are using email authentication, this is the period within which a response will be accepted from users. After this period, old unconfirmed accounts are deleted.';
@@ -186,7 +200,10 @@
186200
$string['confignotifyloginfailures'] = 'If login failures have been recorded, email notifications can be sent out. Who should see these notifications?';
187201
$string['confignotifyloginthreshold'] = 'If notifications about failed logins are active, how many failed login attempts by one user or one IP address is it worth notifying about?';
188202
$string['configopentogoogle'] = 'If you enable this setting, then Google will be allowed to enter your site as a Guest. In addition, people coming in to your site via a Google search will automatically be logged in as a Guest. Note that this only provides transparent access to courses that already allow guest access.';
189-
$string['configproxyhost'] = 'If this <b>server</b> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.';
203+
$string['configpathtoclam'] = 'Path to clam AV. Probably something like /usr/bin/clamscan or /usr/bin/clamdscan. You need this in order for clam AV to run.';
204+
$string['configproxyhost'] = 'If this <B>server</B> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.';
205+
$string['configquarantinedir'] = 'If you want clam AV to move infected files to a quarantine directory, enter it here. It must be writable by the webserver. If you leave this blank, or if you enter a directory that doesn\'t exit or isn\'t writable, infected files will be deleted. Do not include a trailing slash.';
206+
$string['configrunclamonupload'] = 'Run clam AV on file upload? You will need a correct path in pathtoclam for this to work. (Clam AV is a free virus scanner that you can get from http://www.clamav.net/)';
190207
$string['configsecureforms'] = 'Moodle can use an additional level of security when accepting data from web forms. If this is enabled, then the browser\'s HTTP_REFERER variable is checked against the current form address. In a very few cases this can cause problems if the user is using a firewall (eg Zonealarm) configured to strip HTTP_REFERER from their web traffic. Symptoms are getting \'stuck\' on a form. If your users are having problems with the login page (for example) you might want to disable this setting, although it might leave your site more open to brute-force password attacks. If in doubt, leave this set to \'Yes\'.';
191208
$string['configsessioncookie'] = 'This setting customises the name of the cookie used for Moodle sessions. This is optional, and only useful to avoid cookies being confused when there is more than one copy of Moodle running within the same web site.';
192209
$string['configsessiontimeout'] = 'If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended). This variable specifies how long this time should be.';
@@ -996,12 +1013,20 @@
9961013
$string['updatingain'] = 'Updating $a->what in $a->in';
9971014
$string['upload'] = 'Upload';
9981015
$string['uploadafile'] = 'Upload a file';
1016+
$string['uploadedfile'] = 'File uploaded successfully';
1017+
$string['uploadfailednotrecovering'] = 'Your file upload has failed because there was a problem with one of the files, $a->name.<br/> Here is a log of the problems:<br />$a->problem<br />Not recovering.';
1018+
$string['uploadfilelog'] = 'Upload log for file $a';
9991019
$string['uploadedfileto'] = 'Uploaded $a->file to $a->directory';
1020+
$string['uploadedfiletoobig'] = 'Sorry, but that file is too big (limit is $a bytes)';
10001021
$string['uploadformlimit'] = 'Uploaded file exceeded the maximum size limit set by the form';
1022+
$string['uploadlabel'] = 'Title:';
10011023
$string['uploadnofilefound'] = 'No file was found - are you sure you selected one to upload?';
10021024
$string['uploadnotallowed'] = 'Uploads are not allowed';
1025+
$string['uploadoldfilesdeleted'] = 'The old file(s) in your upload area have been deleted';
10031026
$string['uploadpartialfile'] = 'File was only partially uploaded';
10041027
$string['uploadproblem'] = 'An unknown problem occurred while uploading the file \'$a\' (perhaps it was too large?)';
1028+
$string['uploadrenamedchars'] = 'File was renamed from $a->oldname to $a->newname because of invalid characters.';
1029+
$string['uploadrenamedcollision'] = 'File was renamed from $a->oldname to $a->newname because there was a filename conflict.';
10051030
$string['uploadserverlimit'] = 'Uploaded file exceeded the maximum size limit set by the server';
10061031
$string['uploadthisfile'] = 'Upload this file';
10071032
$string['uploadusers'] = 'Upload users';
@@ -1023,6 +1048,13 @@
10231048
$string['usingexistingcourse'] = 'Using existing course';
10241049
$string['version'] = 'Version';
10251050
$string['view'] = 'View';
1051+
$string['virusfoundsubject'] = '$a: Virus found!';
1052+
$string['virusfound'] = 'Attention administrator! Clam AV has found a virus in a file uploaded by $a->user for the course $a->course. Here is the output of clamscan:';
1053+
$string['virusfounduser'] = 'The file you have uploaded, $a->filename, has been scanned by a virus checker and found to be infected! Your file upload was NOT successful.';
1054+
$string['virusfoundlater'] = 'A file you uploaded on $a->date with the filename $a->filename for the course $a->course has since been found to contain a virus. Here is a summary of what has happened to your file:'."\n\n".'$a->action'."\n\n".'If this was submitted work, you may want to resubmit it so that your tutor can see it.';
1055+
$string['virusfoundlateradmin'] = 'Attention administrator! A file that was uploaded on $a->date with the filename $a->filename for the course $a->course by the user $a->user has since been found to contain a virus. Here is a summary of what has happened to the file:'."\n\n".'$a->action'."\n\n".'The user has also been notified.';
1056+
$string['virusfoundlateradminnolog'] = 'Attention administrator! A file that was uploaded with the filename $a->filename has since been found to contain a virus. Moodle was unable to resolve this file back to the user that originally uploaded it.'."\n\n".'Here is a summary of what has happened to the file:'."\n\n".'$a->action';
1057+
$string['virusplaceholder'] = 'This file that has been uploaded was found to contain a virus and has been moved or delted and the user notified.';
10261058
$string['webpage'] = 'Web page';
10271059
$string['week'] = 'Week';
10281060
$string['weekhide'] = 'Hide this week from $a';

0 commit comments

Comments
 (0)