ILIAS  trunk Revision v12.0_alpha-1338-g8f7e531aa3c
UploadSecurityFunctionsTrait.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
26trait UploadSecurityFunctionsTrait
27{
28 protected function getAccess(
29 int $ref_id,
30 \ilAccessHandler $access
31 ): bool {
32 if ($ref_id !== null
33 && $access->checkAccess('write', '', $ref_id)) {
34 return true;
35 }
36
37 return false;
38 }
39
40 protected function getAccessFailureResult(
41 string $file_identification_parameter_name,
42 string $file_name,
43 \ilLanguage $language
44 ): HandlerResult {
45 $language->loadLanguageModule('content');
46 return new BasicHandlerResult(
47 $file_identification_parameter_name,
49 basename($file_name),
50 $language->txt('cont_no_access')
51 );
52 }
53}
language handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
$ref_id
Definition: ltiauth.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))