Example #1
0
 /**
  * @param array $_params
  * @param \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication $pObj
  */
 public function postProcessing($_params, $pObj)
 {
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     /** @var SingleSignOnUtility $singleSignOnUtility */
     $singleSignOnUtility = $this->objectManager->get(SingleSignOnUtility::class);
     $singleSignOnUtility->logout();
     $pObj->removeCookie('PHPSESSID');
 }
Example #2
0
 /**
  * @param array $_params
  * @param \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication $pObj
  */
 public function postProcessing($_params, $pObj)
 {
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     /** @var \Portrino\PxHybridAuth\Utility\SingleSignOnUtility $singleSignOnUtility */
     $singleSignOnUtility = $this->objectManager->get('Portrino\\PxHybridAuth\\Utility\\SingleSignOnUtility');
     $singleSignOnUtility->logout();
     $pObj->removeCookie('PHPSESSID');
 }
Example #3
0
 /**
  * @param array $params
  * @param \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication $pObj
  */
 public function postProcessing($params, $pObj)
 {
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     /** @var \MV\SocialAuth\Utility\AuthUtility $authUtility */
     $authUtility = $this->objectManager->get('MV\\SocialAuth\\Utility\\AuthUtility');
     $authUtility->logout();
     session_start();
     session_destroy();
     $pObj->removeCookie('PHPSESSID');
 }
 /**
  * Determine whether there's an according session record to a given session_id
  * in the database. Don't care if session record is still valid or not.
  *
  * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
  *
  * @param integer $id Claimed Session ID
  * @return boolean Returns TRUE if a corresponding session was found in the database
  * @todo Define visibility
  */
 public function isExistingSessionRecord($id)
 {
     // Perform check in parent function
     $count = parent::isExistingSessionRecord($id);
     // Check if there are any fe_session_data records for the session ID the client claims to have
     if ($count == FALSE) {
         $statement = $this->db->prepare_SELECTquery('content,tstamp', 'fe_session_data', 'hash = :hash');
         $res = $statement->execute(array(':hash' => $id));
         if ($res !== FALSE) {
             if ($sesDataRow = $statement->fetch()) {
                 $count = TRUE;
                 $this->sesData = unserialize($sesDataRow['content']);
                 $this->sessionDataTimestamp = $sesDataRow['tstamp'];
             }
             $statement->free();
         }
     }
     return $count;
 }
 /**
  * Logs out the current user and clears the form protection tokens.
  */
 public function logoff()
 {
     if (isset($GLOBALS['BE_USER'])) {
         \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->clean();
     }
     parent::logoff();
 }
 /**
  * Get a user from DB by username
  *
  * @param string $username User name
  * @param string $extraWhere Additional WHERE clause: " AND ...
  * @param array $dbUserSetup User db table definition: $this->db_user
  * @return mixed User array or FALSE
  * @todo Define visibility
  */
 public function fetchUserRecord($username, $extraWhere = '', $dbUserSetup = '')
 {
     $dbUser = is_array($dbUserSetup) ? $dbUserSetup : $this->db_user;
     $user = $this->pObj->fetchUserRecord($dbUser, $username, $extraWhere);
     return $user;
 }
Example #7
0
 /**
  * Logs out the current user and clears the form protection tokens.
  */
 public function logoff()
 {
     if (isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER'] instanceof self && isset($GLOBALS['BE_USER']->user['uid'])) {
         \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->clean();
     }
     parent::logoff();
 }
 /**
  * Mark the current session as checked
  *
  * @return void
  */
 protected function setValidTwoFactorInSession()
 {
     $this->user->setAndSaveSessionData('authenticatorIsValidTwoFactor', TRUE);
 }
Example #9
0
 /**
  * Determine whether there's an according session record to a given session_id
  * in the database. Don't care if session record is still valid or not.
  *
  * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
  *
  * @param int $id Claimed Session ID
  * @return bool Returns TRUE if a corresponding session was found in the database
  */
 public function isExistingSessionRecord($id)
 {
     // Perform check in parent function
     $count = parent::isExistingSessionRecord($id);
     // Check if there are any fe_session_data records for the session ID the client claims to have
     if ($count == false) {
         $sesDataRow = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_session_data')->select(['content', 'tstamp'], 'fe_session_data', ['hash' => $id])->fetch();
         if ($sesDataRow !== null) {
             $count = true;
             $this->sesData = unserialize($sesDataRow['content']);
             $this->sessionDataTimestamp = $sesDataRow['tstamp'];
         }
     }
     return $count;
 }