-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathext_localconf.php
42 lines (37 loc) · 1.32 KB
/
ext_localconf.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
39
40
41
42
<?php
use Mfc\OAuth2\LoginProvider\OAuth2LoginProvider;
use Mfc\OAuth2\Services\OAuth2LoginService;
defined('TYPO3_MODE') || die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'oauth2',
'auth',
OAuth2LoginService::class,
[
'title' => 'OAuth Authentication',
'description' => 'OAuth authentication service for backend users',
'subtype' => 'getUserBE,authUserBE',
'available' => true,
'priority' => 75,
'quality' => 50,
'os' => '',
'exec' => '',
'className' => OAuth2LoginService::class
]
);
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['oauth2'])) {
$extensionConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['oauth2']);
} elseif (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['oauth2'])) {
$extensionConfig = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['oauth2'];
} else {
$extensionConfig = [
'enableBackendLogin' => false,
];
}
if ($extensionConfig['enableBackendLogin']) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1529672977] = [
'provider' => OAuth2LoginProvider::class,
'sorting' => 25,
'icon-class' => 'fa-sign-in',
'label' => 'LLL:EXT:oauth2/Resources/Private/Language/locallang.xlf:oauth2.login.link'
];
}