Project

General

Profile

Feature #15029 ยป 2005-10-23_bugfix_1573.patch

Administrator Admin, 2005-10-25 11:20

View differences:

TYPO3core/t3lib/stddb/tables.sql 2005-10-23 14:37:36.000000000 +0200
ses_userid int(11) unsigned DEFAULT '0' NOT NULL,
ses_tstamp int(11) unsigned DEFAULT '0' NOT NULL,
ses_data mediumblob NOT NULL,
ses_backuserid int(11) NOT NULL default '0',
PRIMARY KEY (ses_id,ses_name)
);
-- TYPO3core_orig/typo3/alt_menu.php 2005-10-21 10:06:59.000000000 +0200
++ TYPO3core/typo3/alt_menu.php 2005-10-23 19:10:43.000000000 +0200
......
';
}
// superuser mode
if($BE_USER->user['ses_backuserid']) {
$username = '<p id="username" class="typo3-red-background">[SU: '.htmlspecialchars($BE_USER->user['username']).']</p>';
} else {
$username = '<p id="username">['.htmlspecialchars($BE_USER->user['username']).']</p>';
}
// Printing bottons (logout button)
$this->content.='
......
<!--
Logout button / username
-->
<div id="typo3-alt-menu-php-logininfo">'.$alt_menuObj->topButtons().
'<p id="username">['.htmlspecialchars($BE_USER->user['username']).']</p>
<div id="typo3-alt-menu-php-logininfo">'.$alt_menuObj->topButtons().$username.'
</div>';
// End page:
-- TYPO3core_orig/typo3/stylesheet.css 2005-10-21 10:06:59.000000000 +0200
++ TYPO3core/typo3/stylesheet.css 2005-10-23 19:10:29.000000000 +0200
......
/* Red span tag color (warning, notice) */
.typo3-red {color: red;}
.typo3-red-background {background-color: red;}
TABLE.warningbox { border: solid 2px black; background-color: yellow; margin: 20px 0px 20px 0px; }
TABLE.warningbox TD { padding: 20px 20px 20px 20px; font-weight: bold; }
TYPO3core/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php 2005-10-23 14:57:05.000000000 +0200
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Backend user switchback
*
* @author Sebastian Kurfuerst <sebastian@garbage-group.de>
*/
class tx_beuser_switchbackuser {
function switchBack($params, $that) {
if($that->session_table == 'be_sessions' && $that->user['uid'] && $that->user['ses_backuserid']) {
$updateData = array(
'ses_userid' => $that->user['ses_backuserid'],
'ses_backuserid' => 0
);
$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);
header('Location: '.t3lib_div::locationHeaderUrl($GLOBALS['BACK_PATH'].'index.php'.($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces']?'':'?commandLI=1')));
exit;
//$GLOBALS['TYPO4
}
}
}
?>
-- TYPO3core_orig/typo3/sysext/beuser/ext_localconf.php 1970-01-01 01:00:00.000000000 +0100
++ TYPO3core/typo3/sysext/beuser/ext_localconf.php 2005-10-23 14:50:06.000000000 +0200
<?php
if (!defined ("TYPO3_MODE")) die ("Access denied.");
require_once(t3lib_extMgm::extPath('beuser').'class.tx_beuser_switchbackuser.php');
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_feuserauth.php']['logoff_pre_processing'][] = 'tx_beuser_switchbackuser->switchBack';
?>
-- TYPO3core_orig/typo3/sysext/beuser/mod/index.php 2005-10-21 10:06:59.000000000 +0200
++ TYPO3core/typo3/sysext/beuser/mod/index.php 2005-10-23 14:39:30.000000000 +0200
function switchUser($switchUser) {
$uRec=t3lib_BEfunc::getRecord('be_users',$switchUser);
if (is_array($uRec) && $GLOBALS['BE_USER']->isAdmin()) {
$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']), array('ses_userid' => $uRec['uid']));
$updateData = array(
'ses_userid' => $uRec['uid'],
'ses_backuserid' => intval($GLOBALS['BE_USER']->user['uid'])
);
$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);
header('Location: '.t3lib_div::locationHeaderUrl($GLOBALS['BACK_PATH'].'index.php'.($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces']?'':'?commandLI=1')));
exit;
    (1-1/1)