-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathext_localconf.php
executable file
·61 lines (57 loc) · 2.85 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
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$boot = function ($_EXTKEY) {
$composerAutoloadFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Resources/Private/Librairies/autoload.php';
if (file_exists($composerAutoloadFile)) {
require_once($composerAutoloadFile);
}
if (TYPO3_MODE === 'FE') {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MV.' . $_EXTKEY,
'Pi1',
array(
'Auth' => 'list, connect, endpoint',
),
// non-cacheable actions
array(
'Auth' => 'connect, endpoint'
)
);
$extConfig = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
)->get('social_auth');
if ($extConfig['providers']['facebook']['enabled'] || $extConfig['providers']['google']['enabled'] || $extConfig['providers']['twitter']['enabled'] || $extConfig['providers']['instagram']['enabled']) {
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['FE_fetchUserIfNoSession'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'][$_EXTKEY] = 'MV\SocialAuth\Hooks\LogOffHook->postProcessing';
}
//add marker to felogin if is loaded
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('felogin')) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'][$_EXTKEY] = 'MV\SocialAuth\Hooks\FeLoginHook->postProcContent';
}
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService($_EXTKEY,
'auth' /* sv type */,
MV\SocialAuth\Service\SocialAuthenticationService::class /* sv key */,
array(
'title' => 'Social Authentification Service',
'description' => 'authentication for users from social providers (facebook, twitter...)',
'subtype' => 'authUserFE,getUserFE',
'available' => true,
'priority' => 82, /* will be called before default typo3 authentication service */
'quality' => 82,
'os' => '',
'exec' => '',
'className' => MV\SocialAuth\Service\SocialAuthenticationService::class,
)
);
#Exclude some params
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_socialauth_pi1[provider]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_socialauth_pi1[redirect]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_socialauth_pi1[error]';
//globals namespace for viewhelper
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['socialauth'] = ['MV\\SocialAuth\\ViewHelpers'];
};
$boot($_EXTKEY);
unset($boot);