[TASK] Remove XCLASS definitions from typo3/
[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 /**
26 * This class is the OpenID return script for the TYPO3 Frontend.
27 *
28 * @author Dmitry Dulepov <dmitry@typo3.org>
29 */
30 class tx_openid_eID {
31 /**
32 * Processes eID request.
33 *
34 * @return void
35 */
36 public function main() {
37 // Due to the nature of OpenID (redrections, etc) we need to force user
38 // session fetching if there is no session around. This ensures that
39 // our service is called even if there is no login data in the request.
40 // Inside the service we will process OpenID response and authenticate
41 // the user.
42 $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['FE_fetchUserIfNoSession'] = TRUE;
43
44 // Initialize Frontend user
45 tslib_eidtools::connectDB();
46 tslib_eidtools::initFeUser();
47
48 // Redirect to the original location in any case (authenticated or not)
49 @ob_end_clean();
50 t3lib_utility_Http::redirect(t3lib_div::_GP('tx_openid_location'), t3lib_utility_Http::HTTP_STATUS_303);
51 }
52 }
53
54 $module = t3lib_div::makeInstance('tx_openid_eID');
55 /* @var tx_openid_eID $module */
56 $module->main();
57
58 ?>