MDL-36754 core_files: Add a token version of pluginfile

This commit is contained in:
Andrew Nicols 2018-06-03 21:06:45 +08:00
parent 6e445671c1
commit 4a74ab0200
5 changed files with 150 additions and 5 deletions

View file

@ -25,12 +25,16 @@
*/
// Disable moodle specific debug messages and any errors in output.
define('NO_DEBUG_DISPLAY', true);
if (!defined('NO_DEBUG_DISPLAY')) {
define('NO_DEBUG_DISPLAY', true);
}
require_once('config.php');
require_once('lib/filelib.php');
$relativepath = get_file_argument();
if (empty($relativepath)) {
$relativepath = get_file_argument();
}
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
$preview = optional_param('preview', null, PARAM_ALPHANUM);
// Offline means download the file from the repository and serve it, even if it was an external link.