23 $rbacsystem =
$DIC[
'rbacsystem'];
30 $upload_dir =
$lm_set->get(
"cont_upload_dir");
35 }
catch (InvalidArgumentException
$e) {
38 return $scorm_import_directory->getAbsolutePath();
46 if (!$upload_dir = self::_getUploadDirectory()) {
51 $handle = opendir($upload_dir);
53 while (
false !== ($file = readdir($handle))) {
54 $full_path = $upload_dir .
"/" . $file;
55 if (is_file($full_path) and is_readable($full_path)) {
69 return in_array($a_file, $files);
72 public static function _copyUploadFile(
string $a_file,
string $a_target,
bool $a_raise_errors =
true): bool
75 $main_tpl =
$DIC->ui()->mainTemplate();
77 $ilias =
$DIC[
'ilias'];
82 if (!is_file($file)) {
83 if ($a_raise_errors) {
84 $ilias->raiseError(
$lng->txt(
"upload_error_file_not_found"), $ilias->error_obj->MESSAGE);
86 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"upload_error_file_not_found"),
true);
94 if ($a_raise_errors) {
96 $lng->txt(
"file_is_infected") .
"<br />" .
98 $ilias->error_obj->MESSAGE
101 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"file_is_infected") .
"<br />" .
107 $main_tpl->setOnScreenMessage(
'info', $vir[1],
true);
109 return copy($file, $a_target);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
static _checkUploadFile(string $a_file)
static _getUploadDirectory()
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)