|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Data Structures | |
| class | upload_manager |
Namespaces | |
| namespace | core |
| namespace | moodlecore |
Functions | |
| clam_handle_infected_file ($file, $userid=0, $basiconly=false) | |
| clam_replace_infected_file ($file) | |
| clam_scan_moodle_file (&$file, $course) | |
| clam_message_admins ($notice) | |
| get_clam_error_code ($returncode) | |
| clam_log_upload ($newfilepath, $course=null, $nourl=false) | |
| clam_log_infected ($oldfilepath='', $newfilepath='', $userid=0) | |
| clam_change_log ($oldpath, $newpath, $update=true) | |
| clam_change_log | ( | $ | oldpath, |
| $ | newpath, | ||
| $ | update = true |
||
| ) |
Some of the modules allow moving attachments (glossary), in which case we need to hunt down an original log and change the path.
object
| string | $oldpath | The old path to the file (should be in the log) |
| string | $newpath | The new path to the file |
| boolean | $update | If true this function will overwrite old record (used for forum moving etc). |
Definition at line 805 of file uploadlib.php.
| clam_handle_infected_file | ( | $ | file, |
| $ | userid = 0, |
||
| $ | basiconly = false |
||
| ) |
Deals with an infected file - either moves it to a quarantinedir (specified in CFG->quarantinedir) or deletes it.
If moving it fails, it deletes it.
object object
| string | $file | Full path to the file |
| int | $userid | If not used, defaults to $USER->id (there in case called from cron) |
| boolean | $basiconly | Admin level reporting or user level reporting. |
Definition at line 521 of file uploadlib.php.


| clam_log_infected | ( | $ | oldfilepath = '', |
| $ | newfilepath = '', |
||
| $ | userid = 0 |
||
| ) |
This function logs to error_log and to the log table that an infected file has been found and what's happened to it.
object
| string | $oldfilepath | Full path to the infected file before it was moved. |
| string | $newfilepath | Full path to the infected file since it was moved to the quarantine directory (if the file was deleted, leave empty). |
| int | $userid | The user id of the user who uploaded the file. |
Definition at line 780 of file uploadlib.php.


| clam_log_upload | ( | $ | newfilepath, |
| $ | course = null, |
||
| $ | nourl = false |
||
| ) |
Adds a file upload to the log table so that clam can resolve the filename to the user later if necessary
object object
| string | $newfilepath | ? |
| course | $course | $COURSE |
| boolean | $nourl | ? |
Definition at line 758 of file uploadlib.php.


| clam_message_admins | ( | $ | notice | ) |
Emails admins about a clam outcome
| string | $notice | The body of the email to be sent. |
Definition at line 692 of file uploadlib.php.


| clam_replace_infected_file | ( | $ | file | ) |
Replaces the given file with a string.
The replacement string is used to notify that the original file had a virus This is to avoid missing files but could result in the wrong content-type.
| string | $file | Full path to the file. |
Definition at line 584 of file uploadlib.php.
| clam_scan_moodle_file | ( | &$ | file, |
| $ | course | ||
| ) |
If $CFG->runclamonupload is set, we scan a given file. (called from preprocess_files())
This function will add on a uploadlog index in $file.
object object
| mixed | $file | The file to scan from $files. or an absolute path to a file. |
| course | $course | $COURSE |
Definition at line 607 of file uploadlib.php.


| get_clam_error_code | ( | $ | returncode | ) |
Returns the string equivalent of a numeric clam error code
| int | $returncode | The numeric error code in question. return string The definition of the error code |
Definition at line 720 of file uploadlib.php.
