Commit d4597e8b authored by Carsten  Rose's avatar Carsten Rose
Browse files

F6721: Log switching {{feUser:U}} to qfq.log. refs #6721, refs 6721

parent 37714784
Pipeline #931 passed with stage
in 1 minute and 44 seconds
......@@ -146,7 +146,7 @@ class Session {
* Check if the recent logged in feUserUid is equal to the one stored in session: If different, invalidate (clear)
* the session and save the new feUser, feUserUid in the session. If isset($GLOBALS["TSFE"]), than we're in a T3
* environment, else we are called as API classes and need to fake feUser / feUserUid from previous stored session.
* It's neccessary to have feUser / feUserUid available in API classes, due to dynamic update which might reload
* It's necessary to have feUser / feUserUid available in API classes, due to dynamic update which might reload
* data based on feUser / feUserUid.
*/
private static function checkFeUserUid() {
......
......@@ -12,6 +12,7 @@ use qfq;
require_once(__DIR__ . '/../../qfq/helper/KeyValueStringParser.php');
require_once(__DIR__ . '/../../qfq/helper/Sanitize.php');
require_once(__DIR__ . '/../../qfq/helper/Logger.php');
require_once(__DIR__ . '/../../qfq/Constants.php');
require_once(__DIR__ . '/../../qfq/store/Sip.php');
require_once(__DIR__ . '/../../qfq/store/T3Info.php');
......@@ -428,9 +429,9 @@ class Store {
* @param $key
* @param $store
*/
public static function unsetVar($key, $store){
public static function unsetVar($key, $store) {
if(isset(self::$raw[$store][$key])) {
if (isset(self::$raw[$store][$key])) {
unset(self::$raw[$store][$key]);
}
}
......@@ -518,7 +519,7 @@ class Store {
/**
* Fills the STORE_EXTRA.
*
* @param string $storeName STORE_EXTRA, STORE_USER
* @param string $storeName STORE_EXTRA, STORE_USER
* @throws CodeException
* @throws UserFormException
*/
......@@ -652,6 +653,13 @@ class Store {
$data = array();
}
// Switch FeUser: log this to qfq.log
if ($storeName === STORE_USER && $key == TYPO3_FE_USER) {
$qfqLog = self::getVar(SYSTEM_QFQ_LOG, STORE_SYSTEM);
$feUserOld = isset($data[$key]) ? $data[$key] : self::getVar($key, STORE_TYPO3 . STORE_EMPTY);
Logger::logMessage(date('Y.m.d H:i:s ') . ": Switch feUser '$feUserOld' to '$value'", $qfqLog);
}
$data[$key] = $value;
Session::set($storeName, $data);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment