]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/auth/class_CookieAuth.php
Continued:
[core.git] / framework / main / classes / auth / class_CookieAuth.php
index a98999f4c954eb7d7936d98db081612894b9e311..6cd6559a7264868197174fad08420afe5c14f43e 100644 (file)
@@ -1,11 +1,12 @@
 <?php
 // Own namespace
-namespace CoreFramework\Auth;
+namespace Org\Mxchange\CoreFramework\Auth;
 
 // Import framework stuff
-use CoreFramework\Object\BaseFrameworkSystem;
-use CoreFramework\Registry\Registerable;
-use CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
  * A cookie-bases authorization class
@@ -50,9 +51,6 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
                // Get a new instance
                $loginInstance = new CookieAuth();
 
-               // Set the response instance
-               $loginInstance->setResponseInstance($responseInstance);
-
                // Return the prepared instance
                return $loginInstance;
        }
@@ -64,7 +62,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function setUserAuth ($userName) {
-               $this->getResponseInstance()->addCookie('username', $userName);
+               FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName);
        }
 
        /**
@@ -74,7 +72,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function setPasswordAuth ($passHash) {
-               $this->getResponseInstance()->addCookie('u_hash', $passHash);
+               FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash);
        }
 
        /**
@@ -84,7 +82,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function getUserAuth () {
                // Get the username from cookie
-               $userName = $this->getRequestInstance()->readCookie('username');
+               $userName = FrameworkBootstrap::getRequestInstance()->readCookie('username');
 
                // Return the username
                return $userName;
@@ -97,7 +95,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function getPasswordAuth () {
                // Get the username from cookie
-               $passHash = $this->getRequestInstance()->readCookie('u_hash');
+               $passHash = FrameworkBootstrap::getRequestInstance()->readCookie('u_hash');
 
                // Return the username
                return $passHash;
@@ -110,8 +108,8 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function destroyAuthData () {
                // Expire both cookies
-               $this->getResponseInstance()->expireCookie('username');
-               $this->getResponseInstance()->expireCookie('u_hash');
+               FrameworkBootstrap::getResponseInstance()->expireCookie('username');
+               FrameworkBootstrap::getResponseInstance()->expireCookie('u_hash');
        }
 
        /**
@@ -120,8 +118,8 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function updateAuthData () {
-               $this->getResponseInstance()->refreshCookie('username');
-               $this->getResponseInstance()->refreshCookie('u_hash');
+               FrameworkBootstrap::getResponseInstance()->refreshCookie('username');
+               FrameworkBootstrap::getResponseInstance()->refreshCookie('u_hash');
        }
 
 }