/** * 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 $isShared * @dataProvider dataProviderBoolValues */ public function testIsAdminAccountSharingIsEnabled($isShared) { $this->scopeConfigMock->expects($this->once())->method('isSetFlag')->with(\Magento\Security\Helper\SecurityConfig::XML_PATH_ADMIN_ACCOUNT_SHARING)->will($this->returnValue($isShared)); $this->assertEquals($isShared, $this->helper->isAdminAccountSharingEnabled()); }