![]() |
| > Home > Documentation > Latest documentation > Global config directives > FileControl |
|
FileControlControl access to files using rules coded into a custom Perl subroutine. Synopsis
ScopeThis directive is available for use globally (in the "interchange.cfg" configuration file), and locally (in the "catalog.cfg" configuration file). The global configuration affects all websites running under the Interchange instance. Each individual website's local configuration will not affect or influence other websites in any way. DescriptionThis directive allows you to control access to your files with the use of a block of custom Perl code. Your Perl subroutine can grant or deny access to requested files using whatever criteria you need. The custom subroutine will be called with three parameters, as follows:
The return value is expected to be a boolean. A true return value will be taken to mean that access to the requested file should be granted, whereas a false return value will result in the file access request being denied. ExamplesSpecifying a FileControl subroutine inline
Specifying a FileControl subroutine as a Sub or GlobalSubThe FileControl subroutine can be created and installed as a Sub or GlobalSub as follows:
Mapping FileControl to a subroutine in a Perl moduleAssuming you have a Perl module called YourModule, and that module contains an appropriately-coded file_control() subroutine, you may make use of the subroutine as follows:
|
| Home | Legal nonsense | Privacy policy | Contact us |