ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilFileServicesPreProcessor Class Reference

Class ilFileServicesPolicy. More...

+ Inheritance diagram for ilFileServicesPreProcessor:
+ Collaboration diagram for ilFileServicesPreProcessor:

Public Member Functions

 __construct (private ilFileServicesSettings $settings, string $reason='Extension is blacklisted.')
 
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 
- Public Member Functions inherited from ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessor
 __construct (private array $blacklist, private string $reason='Extension is blacklisted.')
 BlacklistExtensionPreProcessor constructor. More...
 
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessor
 checkPath (string $path)
 
 getRejectionMessage ()
 
 getOKMessage ()
 
 checkPath (string $path)
 
 getRejectionMessage ()
 
 getOKMessage ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFileServicesPreProcessor::__construct ( private ilFileServicesSettings  $settings,
string  $reason = 'Extension is blacklisted.' 
)

Definition at line 31 of file class.ilFileServicesPreProcessor.php.

34 {
35 parent::__construct($this->settings->getBlackListedSuffixes(), $reason);
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ process()

ilFileServicesPreProcessor::process ( FileStream  $stream,
Metadata  $metadata 
)

This method gets invoked by the file upload service to process the file with the help of the processor.

If the return value is REJECTED, no further invocations of processors are done for the rejected file.

If the processor fails or returns an unexpected value, the file gets automatically rejected because the file could be dangerous to ILIAS.

Parameters
FileStream$streamThe stream of the file.
Metadata$metadataThe meta data of the uploaded file.
Returns
ProcessingStatus The new status of the file.

Reimplemented from ILIAS\FileUpload\Processor\AbstractRecursiveZipPreProcessor.

Definition at line 39 of file class.ilFileServicesPreProcessor.php.

40 {
41 if ($this->settings->isByPassAllowedForCurrentUser()) {
42 return new ProcessingStatus(ProcessingStatus::OK, 'Blacklist override by RBAC');
43 }
44 return parent::process($stream, $metadata);
45 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: