forked from xperseguers/t3ext-ig_ldap_sso_auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
executable file
·83 lines (67 loc) · 3.57 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
defined('TYPO3_MODE') || defined('TYPO3') || die();
(static function (string $_EXTKEY) {
// Configuration of authentication service
$EXT_CONFIG = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$_EXTKEY] ?? [];
// SSO configuration
if ($EXT_CONFIG['enableFESSO'] ?? false) {
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['FE_fetchUserIfNoSession'] = 1;
}
if ($EXT_CONFIG['enableBESSO'] ?? false) {
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['BE_fetchUserIfNoSession'] = 1;
}
// Visually change the record icon for FE/BE users and groups
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Imaging\IconFactory::class]['overrideIconOverlay'][] = \Causal\IgLdapSsoAuth\Hooks\IconFactory::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = \Causal\IgLdapSsoAuth\Hooks\DatabaseRecordListIconUtility::class;
// Service configuration
$subTypesArr = [];
$subTypes = '';
if ($EXT_CONFIG['enableFELDAPAuthentication'] ?? false) {
$subTypesArr[] = 'getUserFE';
$subTypesArr[] = 'authUserFE';
$subTypesArr[] = 'getGroupsFE';
}
if ($EXT_CONFIG['enableBELDAPAuthentication'] ?? false) {
$subTypesArr[] = 'getUserBE';
$subTypesArr[] = 'authUserBE';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['modifyUserDataBeforeSave'][] = \Causal\IgLdapSsoAuth\Hooks\SetupModuleController::class . '->preprocessData';
}
if (is_array($subTypesArr)) {
$subTypesArr = array_unique($subTypesArr);
$subTypes = implode(',', $subTypesArr);
}
// Register hook for \TYPO3\CMS\Core\DataHandling\DataHandler
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Causal\IgLdapSsoAuth\Hooks\DataHandler::class;
// Register the import users Scheduler task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\Causal\IgLdapSsoAuth\Task\ImportUsers::class] = [
'extension' => $_EXTKEY,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:task.import_users.title',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:task.import_users.description',
'additionalFields' => \Causal\IgLdapSsoAuth\Task\ImportUsersAdditionalFields::class
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
$_EXTKEY,
'auth' /* sv type */,
\Causal\IgLdapSsoAuth\Service\AuthenticationService::class, /* sv key */
[
'title' => 'Authentication service',
'description' => 'Authentication service for LDAP and SSO environment.',
'subtype' => $subTypes,
'available' => true,
'priority' => 80,
'quality' => 80,
'os' => '',
'exec' => '',
'className' => \Causal\IgLdapSsoAuth\Service\AuthenticationService::class,
]
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1553520893] = [
'nodeName' => 'ldapSuggest',
'priority' => 40,
'class' => \Causal\IgLdapSsoAuth\Form\Element\LdapSuggestElement::class,
];
// Register type converters
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter(\Causal\IgLdapSsoAuth\Property\TypeConverter\ConfigurationConverter::class);
// User have save doc new button
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tx_igldapssoauth_config=1');
})('ig_ldap_sso_auth');