]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/registration/class_ShipSimuRegistration.php
Crypto helper and RNG added (weak!)
[shipsimu.git] / application / ship-simu / main / registration / class_ShipSimuRegistration.php
index dd5ef73d611210d964ac2573b9e053b4b979d5f8..ff3a45a34a798b39f8d22e3bd582b671b43de3ed 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class ShipSimuRegistration extends BaseRegistration {
+       /**
+        * Hashed password
+        */
+       private $hashedPassword = "";
+
        /**
         * Private constructor
         *
@@ -52,14 +57,20 @@ class ShipSimuRegistration extends BaseRegistration {
        }
 
        /**
-        * Encrypt the given request key or throws an exception if the key was not
+        * Encrypt the given request key or throw an exception if the key was not
         * found in the request
         *
         * @param       $requestKey             Key in request class
         * @return      void
         */
        public function encryptPassword ($requestKey) {
-               $this->partialStub(sprintf("requestKey=%s", $requestKey));
+               // 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));
+                       $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
+               }
        }
 
        /**