[TASK] Fix CGL violations InlineCommentWrongStyle in ext_emconf.php files
[Packages/TYPO3.CMS.git] / typo3 / sysext / beuser / class.tx_beuser_switchbackuser.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (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 * @author Sebastian Kurfürst <sebastian@garbage-group.de>
28 */
29 class tx_beuser_switchbackuser {
30 function switchBack($params, $that) {
31 if($that->session_table == 'be_sessions' && $that->user['uid'] && $that->user['ses_backuserid']) {
32 $updateData = array(
33 'ses_userid' => $that->user['ses_backuserid'],
34 'ses_backuserid' => 0
35 );
36 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_sessions', 'ses_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions') . ' AND ses_name=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(t3lib_beUserAuth::getCookieName(), 'be_sessions') . ' AND ses_userid=' . intval($GLOBALS['BE_USER']->user['uid']), $updateData);
37
38 $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
39 t3lib_utility_Http::redirect($redirectUrl);
40 }
41 }
42 }
43
44 ?>