This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathext_localconf.php
executable file
·79 lines (64 loc) · 3.47 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
<?php
defined('TYPO3_MODE') || die();
// Configuration of authentication service.
$EXT_CONFIG = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['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
if (version_compare(TYPO3_version, '7.6', '>=')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Core\\Imaging\\IconFactory']['overrideIconOverlay'][] = 'Causal\\IgLdapSsoAuth\\Hooks\\IconFactory';
} else {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][] = 'EXT:' . $_EXTKEY . '/Classes/Hooks/DatabaseRecordListIconUtility.php:Causal\\IgLdapSsoAuth\\Hooks\\DatabaseRecordListIconUtility';
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = 'EXT:' . $_EXTKEY . '/Classes/Hooks/DatabaseRecordListIconUtility.php:Causal\\IgLdapSsoAuth\\Hooks\\DatabaseRecordListIconUtility';
// 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'][] = 'EXT:' . $_EXTKEY . '/Classes/Hooks/SetupModuleController.php:Causal\\IgLdapSsoAuth\\Hooks\\SetupModuleController->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'][] = 'EXT:' . $_EXTKEY . '/Classes/Hooks/DataHandler.php:Causal\\IgLdapSsoAuth\\Hooks\\DataHandler';
// Register the import users Scheduler task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['Causal\\IgLdapSsoAuth\\Task\\ImportUsers'] = [
'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'
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
$_EXTKEY,
'auth' /* sv type */,
'Causal\\IgLdapSsoAuth\\Service\\AuthenticationService' /* 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',
]
);
// Register type converters
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Causal\\IgLdapSsoAuth\\Property\\TypeConverter\\ConfigurationConverter');
// User have save doc new button
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tx_igldapssoauth_config=1');