/** * Handle all others active sessions according Sharing Account Setting * * @return $this */ public function processLogin() { $this->createNewSession(); $olderThen = $this->securityConfig->getCurrentTimestamp() - $this->securityConfig->getAdminSessionLifetime(); if (!$this->securityConfig->isAdminAccountSharingEnabled()) { $result = $this->createAdminSessionInfoCollection()->updateActiveSessionsStatus(AdminSessionInfo::LOGGED_OUT_BY_LOGIN, $this->getCurrentSession()->getUserId(), $this->getCurrentSession()->getSessionId(), $olderThen); if ($result) { $this->currentSession->setIsOtherSessionsTerminated(true); } } return $this; }
/** * @param bool $isOtherSessionsTerminated * @dataProvider dataProviderIsOtherSessionsTerminated */ public function testSetIsOtherSessionsTerminated($isOtherSessionsTerminated) { $this->assertInstanceOf('\\Magento\\Security\\Model\\AdminSessionInfo', $this->model->setIsOtherSessionsTerminated($isOtherSessionsTerminated)); }