@@ -90,12 +90,24 @@ Therefore, it is no longer necessary to include it, even if it is still present
90
90
91
91
- include("../../../inc/includes.php");
92
92
93
+ Resource access restrictions
94
+ ++++++++++++++++++++++++++++
95
+
96
+ In GLPI 11.0, we restrict the resources that can be accessed through a web request.
97
+
98
+ We still support access to the PHP scripts located in the ``/ajax ``, ``/front `` and ``/report `` directories.
99
+ Their URL remains unchanged, for instance, the URL of the ``/front/index.php `` script of your plugin remains ``/plugins/myplugin/front/index.php ``.
100
+
101
+ The static assets must be moved in the ``/public `` directory to be accessible.
102
+ Their URL must not contain the ``/public `` path.
103
+ For instance, the URL of the ``/public/css/styles.css `` stylesheet of your plugin will be ``/plugins/myplugin/css/styles.css ``.
104
+
93
105
Legacy scripts access policy
94
106
++++++++++++++++++++++++++++
95
107
96
108
By default, the access to any PHP script will be allowed only to authenticated users.
97
109
If you need to change this default policy for some of your PHP scripts, you will need to do this in your plugin ``init `` function,
98
- using the ``Glpi\Http\Firewall::addPluginFallbackStrategy () `` method.
110
+ using the ``Glpi\Http\Firewall::addPluginStrategyForLegacyScripts () `` method.
99
111
100
112
.. code-block :: php
101
113
@@ -104,8 +116,8 @@ using the ``Glpi\Http\Firewall::addPluginFallbackStrategy()`` method.
104
116
use Glpi\Http\Firewall;
105
117
106
118
function plugin_init_myplugin() {
107
- Firewall::addPluginFallbackStrategy ('myplugin', '#^/front/api.php/#', Firewall::STRATEGY_NO_CHECK);
108
- Firewall::addPluginFallbackStrategy ('myplugin', '#^/front/dashboard.php$#', Firewall::STRATEGY_CENTRAL_ACCESS);
119
+ Firewall::addPluginStrategyForLegacyScripts ('myplugin', '#^/front/api.php/#', Firewall::STRATEGY_NO_CHECK);
120
+ Firewall::addPluginStrategyForLegacyScripts ('myplugin', '#^/front/dashboard.php$#', Firewall::STRATEGY_CENTRAL_ACCESS);
109
121
}
110
122
111
123
The following strategies are available:
0 commit comments