$this->setObjectDescription("Registration handling command for Ship-Simu");
// Create unique ID number
- $this->createUniqueID();
+ $this->generateUniqueId();
// Clean up a little
$this->removeNumberFormaters();
// Get the controller instance from the resolver (breaks MVC pattern again)
$controllerInstance = $resolverInstance->getControllerInstance();
- // @TODO Add some more pre/post filters to the controller
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator'));
+ /* @TODO Add some more pre/post filters to the controller */
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
// Return the prepared instance
return $commandInstance;
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- $this->partialStub();
+ // First get a UserRegistration instance
+ $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class');
+
+ // First set request and response instance
+ $registerInstance->setRequestInstance($requestInstance);
+ $registerInstance->setResponseInstance($responseInstance);
+
+ // Encrypt the password
+ $registerInstance->encryptPassword('pass1');
+
+ // Do things before registration
+ $registerInstance->doPreRegistration();
+
+ // Register the new user
+ $registerInstance->registerNewUser();
+
+ // Do things after registration like notifying partner pages or queueing
+ // them for notification
+ $registerInstance->doPostRegistration();
+
+ // Redirect or login after registration
+ $registerInstance->doPostAction();
}
}