From 4c29245ddb24b9358ba520b6d8cf13872646a71e Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 9 Nov 2022 11:21:09 +0100 Subject: [PATCH] rename module methods in extended OXID classes to prevent conflicts with other modules --- .../Component/d3_webauthn_UserComponent.php | 24 +++++++------------ src/Setup/Events.php | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/Modules/Application/Component/d3_webauthn_UserComponent.php b/src/Modules/Application/Component/d3_webauthn_UserComponent.php index bc88f37..91b05c1 100755 --- a/src/Modules/Application/Component/d3_webauthn_UserComponent.php +++ b/src/Modules/Application/Component/d3_webauthn_UserComponent.php @@ -70,7 +70,7 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent $this->getParent()->getViewConfig()->getNavFormParams() ); - $sUrl = $this->getConfig()->getShopHomeUrl() . 'cl=d3webauthnlogin'; + $sUrl = Registry::getConfig()->getShopHomeUrl() . 'cl=d3webauthnlogin'; Registry::getUtils()->redirect($sUrl, true, 302); } } @@ -86,14 +86,6 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent return oxNew(Webauthn::class); } - /** - * @return UtilsView - */ - public function d3GetUtilsView(): UtilsView - { - return Registry::getUtilsView(); - } - public function d3CancelWebauthnLogin(): void { $this->d3WebauthnClearSessionVariables(); @@ -104,16 +96,16 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent */ public function d3WebauthnClearSessionVariables(): void { - $this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTCLASS); - $this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER); - $this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS); - $this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_LOGIN_OBJECT); + $this->d3WebauthnGetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTCLASS); + $this->d3WebauthnGetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER); + $this->d3WebauthnGetSession()->deleteVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS); + $this->d3WebauthnGetSession()->deleteVariable(WebauthnConf::WEBAUTHN_LOGIN_OBJECT); } /** * @return Session */ - public function d3GetSession(): Session + public function d3WebauthnGetSession(): Session { return Registry::getSession(); } @@ -144,8 +136,8 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent // relogin, don't extract from this try block $setSessionCookie = Registry::getRequest()->getRequestParameter('lgn_cook'); - $this->d3GetSession()->setVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH, $credential); - $this->d3GetSession()->setVariable('usr', $user->getId()); + $this->d3WebauthnGetSession()->setVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH, $credential); + $this->d3WebauthnGetSession()->setVariable('usr', $user->getId()); $this->setUser(null); $this->setLoginStatus(USER_LOGIN_SUCCESS); diff --git a/src/Setup/Events.php b/src/Setup/Events.php index 00690a5..9b56c02 100755 --- a/src/Setup/Events.php +++ b/src/Setup/Events.php @@ -201,7 +201,7 @@ class Events ) ) ->setMaxResults(1); - return $qb->execute()->fetchOne(); + return (bool) $qb->execute()->fetchOne(); } /**