-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathext_localconf.php
167 lines (145 loc) · 5.83 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
defined('TYPO3_MODE') || die();
$boot = function ($_EXTKEY) {
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['px_hybrid_auth']);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
$_EXTKEY,
'auth',
\Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService::class,
[
'title' => 'PxHybridAuth Social Login',
'description' => 'Single Sign On via Social Provider',
'subtype' => 'authUserFE,getUserFE',
'available' => true,
'priority' => 82, /* will be called before default typo3 authentication service */
'quality' => 82,
'os' => '',
'exec' => '',
'className' => \Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService::class
]
);
if (TYPO3_MODE === 'FE') {
// Endpoint-Plugin
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Portrino.' . $_EXTKEY,
'HybridAuth',
[
'HybridAuth' => 'endpoint',
],
// non-cacheable actions
[
'HybridAuth' => 'endpoint',
]
);
// Login-Plugin
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Portrino.' . $_EXTKEY,
'Login',
[
'FacebookUser' => 'newLogin',
'LinkedinUser' => 'newLogin',
'XingUser' => 'newLogin',
],
// non-cacheable actions
[
'FacebookUser' => 'newLogin',
'LinkedinUser' => 'newLogin',
'XingUser' => 'newLogin',
]
);
// Identity-Plugin
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Portrino.' . $_EXTKEY,
'Identity',
[
'Identity' => 'list,remove',
'Identity\FacebookIdentity' => 'create,remove',
'Identity\LinkedinIdentity' => 'create,remove',
'Identity\XingIdentity' => 'create,remove'
],
// non-cacheable actions
[
'Identity' => 'list,remove',
'Identity\FacebookIdentity' => 'create,remove',
'Identity\LinkedinIdentity' => 'create,remove',
'Identity\XingIdentity' => 'create,remove'
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'setup',
'[GLOBAL]
tt_content.px_hybrid_auth_login = COA
tt_content.px_hybrid_auth_login {
10 = < lib.stdheader
20 >
20 = < plugin.tx_pxhybridauth_login
}
', true);
if ((boolean)$extConf['provider.']['facebook.']['enabled'] ||
(boolean)$extConf['provider.']['linkedin.']['enabled'] ||
(boolean)$extConf['provider.']['xing.']['enabled']
) {
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing']) === false ) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'] = [];
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'][$_EXTKEY] =
\Portrino\PxHybridAuth\Hooks\LogOffHook::class . '->postProcessing';
}
if ((boolean)$extConf['auto_fe_user_creation.']['enabled']) {
$signalSlotDispatcher->connect(
\Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService::class,
'getUser',
\Portrino\PxHybridAuth\Slots\SocialLoginAuthenticationServiceSlot::class,
'getUser',
false
);
}
}
if (TYPO3_MODE === 'BE') {
/**
* register hooks
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][$_EXTKEY] =
\Portrino\PxHybridAuth\Hooks\PageLayoutViewDrawItemHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] =
\Portrino\PxHybridAuth\Hooks\DataHandlerHook::class;
/**
* register icons for each plugin
*/
$pluginSignatures = [
'px_hybrid_auth_login',
'px_hybrid_auth_identity'
];
foreach ($pluginSignatures as $pluginSignature) {
$iconRegistry->registerIcon(
str_replace('_', '-', $pluginSignature),
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
[
'source' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/' . $pluginSignature . '.svg'
]
);
}
/**
* register icons for each identity types
*/
$identityTypes = [
'facebook',
'xing',
'linkedin'
];
foreach ($identityTypes as $identityType) {
$iconRegistry->registerIcon(
'identity-' . $identityType,
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
[
'name' => $identityType
]
);
}
}
};
$boot($_EXTKEY);
unset($boot);