forked from xperseguers/t3ext-ig_ldap_sso_auth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_localconf.php
executable file
·81 lines (72 loc) · 3.38 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
<?php
defined('TYPO3_MODE') || die();
call_user_func(function () {
// Configuration of authentication service.
$EXT_CONFIG = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['ig_ldap_sso_auth'];
// SSO configuration
if ((bool)$EXT_CONFIG['enableFESSO']) {
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['FE_fetchUserIfNoSession'] = 1;
}
if ((bool)$EXT_CONFIG['enableBESSO']) {
$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'][1518110608]
= \Causal\IgLdapSsoAuth\Hooks\IconFactory::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][1518110608]
= \Causal\IgLdapSsoAuth\Hooks\DatabaseRecordListIconUtility::class;
// Service configuration
$subTypesArr = [];
$subTypes = '';
if ($EXT_CONFIG['enableFELDAPAuthentication']) {
$subTypesArr[] = 'getUserFE';
$subTypesArr[] = 'authUserFE';
$subTypesArr[] = 'getGroupsFE';
}
if ($EXT_CONFIG['enableBELDAPAuthentication']) {
$subTypesArr[] = 'getUserBE';
$subTypesArr[] = 'authUserBE';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['modifyUserDataBeforeSave'][1518110608]
= \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'][1518110608]
= \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' => 'ig_ldap_sso_auth',
'title' => 'LLL:EXT:ig_ldap_sso_auth/Resources/Private/Language/locallang.xlf:task.import_users.title',
'description' => 'LLL:EXT:ig_ldap_sso_auth/Resources/Private/Language/locallang.xlf:task.import_users.description',
'additionalFields' => \Causal\IgLdapSsoAuth\Task\ImportUsersAdditionalFields::class
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'ig_ldap_sso_auth',
// sv type
'auth',
// sv key
\Causal\IgLdapSsoAuth\Service\AuthenticationService::class,
[
'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,
]
);
// 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'
);
});