removed empty lines at the end of the files
[Packages/TYPO3.CMS.git] / typo3 / sysext / beuser / class.tx_beuser_switchbackuser.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
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 * Backend user switchback
26 *
27 * $Id$
28 *
29 * @author Sebastian Kurfuerst <sebastian@garbage-group.de>
30 */
31 class tx_beuser_switchbackuser {
32 function switchBack($params, $that) {
33 if($that->session_table == 'be_sessions' && $that->user['uid'] && $that->user['ses_backuserid']) {
34 $updateData = array(
35 'ses_userid' => $that->user['ses_backuserid'],
36 'ses_backuserid' => 0
37 );
38 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_sessions', 'ses_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions').' AND ses_name=\'be_typo_user\' AND ses_userid='.intval($GLOBALS['BE_USER']->user['uid']),$updateData);
39
40 header('Location: '.t3lib_div::locationHeaderUrl($GLOBALS['BACK_PATH'].'index.php'.($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces']?'':'?commandLI=1')));
41 exit;
42 //$GLOBALS['TYPO4
43 }
44 }
45 }
46
47 ?>