--- TYPO3core_orig/t3lib/stddb/tables.sql 2005-10-21 10:06:59.000000000 +0200 +++ TYPO3core/t3lib/stddb/tables.sql 2005-10-23 14:37:36.000000000 +0200 @@ -50,6 +50,7 @@ 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 @@ -162,6 +162,12 @@ '; } + // superuser mode + if($BE_USER->user['ses_backuserid']) { + $username = '

[SU: '.htmlspecialchars($BE_USER->user['username']).']

'; + } else { + $username = '

['.htmlspecialchars($BE_USER->user['username']).']

'; + } // Printing bottons (logout button) $this->content.=' @@ -169,8 +175,7 @@ -
'.$alt_menuObj->topButtons(). - '

['.htmlspecialchars($BE_USER->user['username']).']

+
'.$alt_menuObj->topButtons().$username.'
'; // 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 @@ -485,6 +485,7 @@ /* 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; } diff -urN TYPO3core_orig/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php TYPO3core/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php --- TYPO3core_orig/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php 1970-01-01 01:00:00.000000000 +0100 +++ TYPO3core/typo3/sysext/beuser/class.tx_beuser_switchbackuser.php 2005-10-23 14:57:05.000000000 +0200 @@ -0,0 +1,46 @@ + + */ + +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 @@ -0,0 +1,7 @@ +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 @@ -1378,7 +1384,11 @@ 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;