-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_config.php
38 lines (30 loc) · 1.14 KB
/
_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
use Composer\InstalledVersions;
use SilverStripe\View\Requirements;
// ! For Security pages only
if (strpos($_SERVER['REQUEST_URI'], '/Security') !== false) {
// 1) Block
// silverstripe-mfa
if (InstalledVersions::isInstalled('silverstripe/mfa')) {
Requirements::block('silverstripe/mfa: client/dist/styles/bundle.css');
// silverstripe/totp-authenticator
if (InstalledVersions::isInstalled('silverstripe/totp-authenticator')) {
Requirements::block(
'silverstripe/totp-authenticator: client/dist/styles/bundle.css',
);
}
}
// 2) Inject
// silverstripe-mfa
if (InstalledVersions::isInstalled('silverstripe/mfa')) {
Requirements::css(
'goldfinch/enchantment:client/dist/enchantment/assets/bundle-silverstripe-mfa.css',
);
// silverstripe/totp-authenticator
if (InstalledVersions::isInstalled('silverstripe/totp-authenticator')) {
Requirements::css(
'goldfinch/enchantment:client/dist/enchantment/assets/bundle-silverstripe-totp-authenticator.css',
);
}
}
}