]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/registration/class_ShipSimuRegistration.php
Comments fixed... ;) And pre/post filters for registrations now supported
[shipsimu.git] / application / ship-simu / main / registration / class_ShipSimuRegistration.php
index ff3a45a34a798b39f8d22e3bd582b671b43de3ed..252d05df20457e27e37311af7fe3ff711db0c5ea 100644 (file)
@@ -28,7 +28,7 @@ class ShipSimuRegistration extends BaseRegistration {
        private $hashedPassword = "";
 
        /**
-        * Private constructor
+        * Protected constructor
         *
         * @return      void
         */
@@ -52,6 +52,9 @@ class ShipSimuRegistration extends BaseRegistration {
                // Get a new instance
                $registrationInstance = new ShipSimuRegistration();
 
+               // Initialize the filter chains
+               $registrationInstance->initFilterChains();
+
                // And return it
                return $registrationInstance;
        }
@@ -67,8 +70,12 @@ class ShipSimuRegistration extends BaseRegistration {
                // Check if the password is found in the request
                if ($this->getRequestInstance()->isRequestElementSet($requestKey)) {
                        // So encrypt the password and store it for later usage in
-                       // the request
-                       $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_heler')->hashPassword($this->getRequestInstance()->getRequestElement($requestKey));
+                       // the request:
+                       // 1.: Get the plain password
+                       $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey);
+                       // 2. Get a crypto helper and hash the password
+                       $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_heler')->hashPassword($plainPassword);
+                       // 3. Store the hash back in the request
                        $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
                }
        }
@@ -80,7 +87,8 @@ class ShipSimuRegistration extends BaseRegistration {
         * @return      void
         */
        public function doPreRegistration () {
-               $this->partialStub();
+               // First run all pre filters
+               $this->executePreFilters();
        }
 
        /**
@@ -99,7 +107,8 @@ class ShipSimuRegistration extends BaseRegistration {
         * @return      void
         */
        public function doPostRegistration () {
-               $this->partialStub();
+               // First run all post filters
+               $this->executePostFilters();
        }
 
        /**