[FEATURE] Lazy database connection
[Packages/TYPO3.CMS.git] / typo3 / sysext / openid / Classes / OpenidEid.php
1 <?php
2 namespace TYPO3\CMS\Openid;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2008-2013 Dmitry Dulepov <dmitry@typo3.org>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * This class is the OpenID return script for the TYPO3 Frontend.
28 *
29 * @author Dmitry Dulepov <dmitry@typo3.org>
30 */
31 class OpenidEid {
32
33 /**
34 * Processes eID request.
35 *
36 * @return void
37 */
38 public function main() {
39 // Due to the nature of OpenID (redrections, etc) we need to force user
40 // session fetching if there is no session around. This ensures that
41 // our service is called even if there is no login data in the request.
42 // Inside the service we will process OpenID response and authenticate
43 // the user.
44 $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['FE_fetchUserIfNoSession'] = TRUE;
45 // Initialize Frontend user
46 \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
47 // Redirect to the original location in any case (authenticated or not)
48 @ob_end_clean();
49 \TYPO3\CMS\Core\Utility\HttpUtility::redirect(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tx_openid_location'), \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303);
50 }
51
52 }
53
54
55 ?>