Skip to content
Snippets Groups Projects
Commit d576f672 authored by mattwire's avatar mattwire
Browse files

Trigger firewall via civi.invoke.auth event

parent f80524d2
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,11 @@ Releases use the following numbering system:
* **[BC]**: Items marked with [BC] indicate a breaking change that will require updates to your code if you are using that code in your extension.
## 1.4
* Implement IP address block list and IPv4 wildcards for block/safelist (eg. 192.168.*).
* Trigger firewall via `civi.invoke.auth` event. `hook_civicrm_config` can run too early and cause classloader issues - should fix [#18](https://lab.civicrm.org/extensions/firewall/-/issues/18).
## 1.3
* Convert Firewall to use non-static methods and provide a "reason" string on failure.
......
......@@ -10,8 +10,14 @@ use CRM_Firewall_ExtensionUtil as E;
*/
function firewall_civicrm_config(&$config) {
_firewall_civix_civicrm_config($config);
// Defaults are not loaded until *after* hook_civicrm_config is called by default
\Civi::service('settings_manager')->useDefaults();
// Symfony hook priorities - see https://docs.civicrm.org/dev/en/latest/hooks/usage/symfony/#priorities
// Run early
// civi.invoke.auth available from 5.36 - https://github.com/civicrm/civicrm-core/pull/19590/commits/e09616fd15aa438d4c904d3fb9da23b4893d1878
Civi::dispatcher()->addListener('civi.invoke.auth', 'firewall_civicrm_boot', 1000);
}
function firewall_civicrm_boot() {
$firewall = new \Civi\Firewall\Firewall();
$firewall->run();
}
......
......@@ -15,8 +15,8 @@
<url desc="Support">https://mjw.pt/support/firewall</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-11-15</releaseDate>
<version>1.3</version>
<releaseDate>2021-12-01</releaseDate>
<version>1.4</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.40</ver>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment