Added SVN properties.
[Packages/TYPO3.CMS.git] / typo3 / sysext / openid / class.tx_openid_eid.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2008 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 * $Id$
41 *
42 * @author Dmitry Dulepov <dmitry@typo3.org>
43 */
44 class tx_openid_eID {
45 /**
46 * Processes eID request.
47 *
48 * @return void
49 */
50 public function main() {
51 // Due to the nature of OpenID (redrections, etc) we need to force user
52 // session fetching if there is no session around. This ensures that
53 // our service is called even if there is no login data in the request.
54 // Inside the service we will process OpenID response and authenticate
55 // the user.
56 $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['FE_fetchUserIfNoSession'] = true;
57
58 // Initialize Frontend user
59 tslib_eidtools::connectDB();
60 tslib_eidtools::initFeUser();
61
62 // Redirect to the original location in any case (authenticated or not)
63 @ob_end_clean();
64 header(t3lib_div::HTTP_STATUS_303);
65 header('Location: ' . t3lib_div::locationHeaderUrl(t3lib_div::GPvar('tx_openid_location')));
66 exit;
67 }
68 }
69
70 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/openid/class.tx_openid_eid.php']) {
71 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/openid/class.tx_openid_eid.php']);
72 }
73
74 $module = t3lib_div::makeInstance('tx_openid_eID');
75 /* @var tx_openid_eID $module */
76 $module->main();
77
78 ?>