28 $rbacsystem =
$DIC[
'rbacsystem'];
35 $upload_dir =
$lm_set->get(
"cont_upload_dir");
40 }
catch (InvalidArgumentException) {
43 return $scorm_import_directory->getAbsolutePath();
52 if ($upload_dir ===
'' || $upload_dir ===
'0') {
57 $handle = opendir($upload_dir);
59 while (
false !== ($file = readdir($handle))) {
60 $full_path = $upload_dir .
"/" . $file;
61 if (is_file($full_path) && is_readable($full_path)) {
75 return in_array($a_file, $files);
78 public static function _copyUploadFile(
string $a_file,
string $a_target,
bool $a_raise_errors =
true): bool
81 $main_tpl =
$DIC->ui()->mainTemplate();
83 $ilias =
$DIC[
'ilias'];
88 if (!is_file($file)) {
89 if ($a_raise_errors) {
90 $ilias->raiseError(
$lng->txt(
"upload_error_file_not_found"), $ilias->error_obj->MESSAGE);
92 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"upload_error_file_not_found"),
true);
100 if ($a_raise_errors) {
102 $lng->txt(
"file_is_infected") .
"<br />" .
104 $ilias->error_obj->MESSAGE
107 $main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"file_is_infected") .
"<br />" .
113 $main_tpl->setOnScreenMessage(
'info', $vir[1],
true);
115 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)