Difference between revisions of "Addons:Request"
Jump to navigation
Jump to search
(Created page with "== General and Name == The request environment can be used to provide pages that can be called for example in AJAX requests. It's a clean site, but with all variables, classes...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
The request environment can be used to provide pages that can be called for example in AJAX requests. It's a clean site, but with all variables, classes and functions that GExtension has. The request file is then available under request.php?t=<rawname>. | The request environment can be used to provide pages that can be called for example in AJAX requests. It's a clean site, but with all variables, classes and functions that GExtension has. The request file is then available under request.php?t=<rawname>. | ||
Line 17: | Line 16: | ||
By default, using a request page is only possible when logged in. To make a file public, you need to run the following function once (may put it in the install.php): | By default, using a request page is only possible when logged in. To make a file public, you need to run the following function once (may put it in the install.php): | ||
NoAuthFiles::Add('request', '<rawname>'); | NoAuthFiles::Add('request', '<rawname>'); | ||
+ | |||
+ | [[Category:Addons]] |
Latest revision as of 09:27, 21 May 2017
The request environment can be used to provide pages that can be called for example in AJAX requests. It's a clean site, but with all variables, classes and functions that GExtension has. The request file is then available under request.php?t=<rawname>.
If a request page is related to a page, the file should have the same name.
Security Check
To verify that the file was included by GExtension, it's required to include the following code at the beginning of the file:
<?php if(!isset($G_REQUEST)){ die(json_encode(array("error" => "authentification failed"))); } ?>
No Login
By default, using a request page is only possible when logged in. To make a file public, you need to run the following function once (may put it in the install.php):
NoAuthFiles::Add('request', '<rawname>');