*/
class ShipSimuRegistration extends BaseRegistration {
/**
- * Private constructor
+ * Hashed password
+ */
+ private $hashedPassword = "";
+
+ /**
+ * Protected constructor
*
* @return void
*/
// Get a new instance
$registrationInstance = new ShipSimuRegistration();
+ // Initialize the filter chains
+ $registrationInstance->initFilterChains();
+
// And return it
return $registrationInstance;
}
/**
- * 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:
+ // 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);
+ }
}
/**
* @return void
*/
public function doPreRegistration () {
- $this->partialStub();
+ // First run all pre filters
+ $this->executePreFilters();
}
/**
* @return void
*/
public function doPostRegistration () {
- $this->partialStub();
+ // First run all post filters
+ $this->executePostFilters();
}
/**