[TYPO3-dev] fe_user disable simultaneous login

Samir Rachidi sr at plusb.de
Fri Nov 7 11:23:48 CET 2014


Hey Christian, 
thank you very much! 

After writing the last post, i found this post: http://lists.typo3.org/pipermail/typo3-german/2010-June/069342.html

Just a hint for our english users in the community:

You can look into following code for deleting the user session:

        $user = get_object_vars($GLOBALS["TSFE"]->fe_user);
        $uid = $user['user']['uid'];
        $ses_id = $GLOBALS["TSFE"]->fe_user->id;
        if (!empty($uid)) {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ses_id', 'fe_sessions', 'ses_userid= ' . $uid);
            while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                $rows[] = $row;
            }
            if (sizeof($rows) > 1) {
                $query = tx_pp_fc_db::buildQueryArray('ses_id',,);
                $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_sessions', 'ses_userid =' . $uid . ' AND ses_id != '".$ses_id."'');
            }
        }




More information about the TYPO3-dev mailing list