* @link http://www.oxidmodule.com */ namespace D3\Webauthn\Modules\Application\Controller; use D3\Webauthn\Application\Model\Webauthn; use D3\Webauthn\Application\Model\WebauthnConf; use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Session; trait d3_webauthn_getUserTrait { /** * @return bool|object|User */ public function getUser() { $user = parent::getUser(); if ($user && $user->getId()) { $webauthn = $this->d3GetWebauthnpObject(); if ($webauthn->isActive($user->getId()) && false == $this->d3GetSessionObject()->getVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH) ) { return false; } } return $user; } /** * @return Webauthn */ public function d3GetWebauthnObject() { return oxNew(Webauthn::class); } /** * @return Session */ public function d3GetSessionObject() { return Registry::getSession(); } }