[!!!][SECURITY] Add CSRF protection to mod.php
[Packages/TYPO3.CMS.git] / typo3 / sysext / openid / ext_tables.php
1 <?php
2 // Make sure that we are executed only from the inside of TYPO3
3 if (!defined('TYPO3_MODE')) {
4 die('Access denied.');
5 }
6 // Prepare new columns for be_users table
7 $tempColumns = array(
8 'tx_openid_openid' => array(
9 'exclude' => 0,
10 'label' => 'LLL:EXT:openid/locallang_db.xlf:be_users.tx_openid_openid',
11 'config' => array(
12 'type' => 'input',
13 'size' => '30',
14 // Requirement: unique (BE users are unique in the whole system)
15 'eval' => 'trim,nospace,unique',
16 'wizards' => Array(
17 '_PADDING' => 2,
18 '0' => Array(
19 'type' => 'popup',
20 'title' => 'Add OpenID',
21 'module' => array(
22 'name' => 'wizard_openid'
23 ),
24 'icon' => 'EXT:openid/ext_icon.gif',
25 'JSopenParams' => ',width=600,height=400,status=0,menubar=0,scrollbars=0',
26 )
27 ),
28 )
29 )
30 );
31 // Add new columns to be_users table
32 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns);
33 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_openid_openid;;;;1-1-1', '', 'after:username');
34 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('be_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xlf');
35 // Prepare new columns for fe_users table
36 $tempColumns['tx_openid_openid']['config']['eval'] = 'trim,nospace,uniqueInPid';
37 // Add new columns to fe_users table
38 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns);
39 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField('fe_users', 'username', 'tx_openid_openid');
40 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xlf');
41 // Add field to setup module
42 $GLOBALS['TYPO3_USER_SETTINGS']['columns']['tx_openid_openid'] = array(
43 'type' => 'user',
44 'table' => 'be_users',
45 'label' => 'LLL:EXT:openid/locallang_db.xlf:_MOD_user_setup.tx_openid_openid',
46 'csh' => 'tx_openid_openid',
47 'userFunc' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup->renderOpenID',
48 'access' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup'
49 );
50 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToUserSettings('tx_openid_openid', 'after:password2');
51 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_user_setup', 'EXT:openid/locallang_csh_mod.xlf');
52
53 if (TYPO3_MODE === 'BE') {
54 // Register wizard
55 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
56 'wizard_openid',
57 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'wizard/'
58 );
59 }