[TASK] Change "true" into "TRUE"
[Packages/TYPO3.CMS.git] / typo3 / sysext / openid / class.tx_openid_eid.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2008-2011 Dmitry Dulepov <dmitry@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24 /**
25 * [CLASS/FUNCTION INDEX of SCRIPT]
26 *
27 *
28 *
29 * 44: class tx_openid_eID
30 * 50: public function main()
31 *
32 * TOTAL FUNCTIONS: 1
33 * (This index is automatically created/updated by the extension "extdeveval")
34 *
35 */
36
37 /**
38 * This class is the OpenID return script for the TYPO3 Frontend.
39 *
40 * @author Dmitry Dulepov <dmitry@typo3.org>
41 */
42 class tx_openid_eID {
43 /**
44 * Processes eID request.
45 *
46 * @return void
47 */
48 public function main() {
49 // Due to the nature of OpenID (redrections, etc) we need to force user
50 // session fetching if there is no session around. This ensures that
51 // our service is called even if there is no login data in the request.
52 // Inside the service we will process OpenID response and authenticate
53 // the user.
54 $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['FE_fetchUserIfNoSession'] = TRUE;
55
56 // Initialize Frontend user
57 tslib_eidtools::connectDB();
58 tslib_eidtools::initFeUser();
59
60 // Redirect to the original location in any case (authenticated or not)
61 @ob_end_clean();
62 t3lib_utility_Http::redirect(t3lib_div::_GP('tx_openid_location'), t3lib_utility_Http::HTTP_STATUS_303);
63 }
64 }
65
66 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/openid/class.tx_openid_eid.php'])) {
67 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/openid/class.tx_openid_eid.php']);
68 }
69
70 $module = t3lib_div::makeInstance('tx_openid_eID');
71 /* @var tx_openid_eID $module */
72 $module->main();
73
74 ?>