24 $rbacsystem = $DIC[
'rbacsystem'];
31 $upload_dir =
$lm_set->get(
"cont_upload_dir");
39 return $scorm_import_directory->getAbsolutePath();
47 if (!$upload_dir = self::_getUploadDirectory()) {
52 $handle = opendir($upload_dir);
54 while (
false !== ($file = readdir($handle))) {
55 $full_path = $upload_dir .
"/" . $file;
56 if (is_file($full_path) and is_readable($full_path)) {
68 $files = self::_getUploadFiles();
70 return in_array($a_file, $files);
73 public static function _copyUploadFile(
string $a_file,
string $a_target,
bool $a_raise_errors =
true): bool
76 $main_tpl = $DIC->ui()->mainTemplate();
78 $ilias = $DIC[
'ilias'];
80 $file = self::_getUploadDirectory() .
"/" . $a_file;
83 if (!is_file($file)) {
84 if ($a_raise_errors) {
85 $ilias->raiseError(
$lng->txt(
"upload_error_file_not_found"), $ilias->error_obj->MESSAGE);
87 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"upload_error_file_not_found"),
true);
95 if ($a_raise_errors) {
97 $lng->txt(
"file_is_infected") .
"<br />" .
99 $ilias->error_obj->MESSAGE
102 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"file_is_infected") .
"<br />" .
108 $main_tpl->setOnScreenMessage(
'info', $vir[1],
true);
110 return copy($file, $a_target);
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
static _getUploadDirectory()
static _checkUploadFile(string $a_file)