application/ship-simu/main/personell/class_SimulatorPersonell.php -text
application/ship-simu/main/personell/company/.htaccess -text
application/ship-simu/main/personell/company/class_CompanyEmployee.php -text
+application/ship-simu/main/registration/.htaccess -text
+application/ship-simu/main/registration/class_ShipSimuRegistration.php -text
application/ship-simu/main/ships/.htaccess -text
application/ship-simu/main/ships/class_BaseShip.php -text
application/ship-simu/main/ships/passenger/.htaccess -text
inc/classes/interfaces/io/output/class_OutputStreamer.php -text
inc/classes/interfaces/language/.htaccess -text
inc/classes/interfaces/language/class_ManageableLanguage.php -text
+inc/classes/interfaces/registration/.htaccess -text
+inc/classes/interfaces/registration/class_UserRegister.php -text
inc/classes/interfaces/registry/.htaccess -text
inc/classes/interfaces/registry/class_Register.php -text
inc/classes/interfaces/registry/class_Registerable.php -text
inc/classes/main/output/.htaccess -text
inc/classes/main/output/class_ConsoleOutput.php -text
inc/classes/main/output/class_WebOutput.php -text
+inc/classes/main/registration/.htaccess -text
+inc/classes/main/registration/class_BaseRegistration.php -text
inc/classes/main/registry/.htaccess -text
inc/classes/main/registry/class_Registry.php -text
inc/classes/main/request/.htaccess -text
{?navigation?}
<div id="main_header">
-{app_selector_header}
+{?app_selector_header?}
</div>
<div id="main_content">
</div>
<div id="main_footer">
-{app_selector_footer}
+{?app_selector_footer?}
</div>
{?footer?}
// CFG: COMMAND-PARAMETER
$cfg->setConfigEntry('command_parameter', "page");
+// CFG: USER-REGISTRATION
+$cfg->setConfigEntry('user_registration', "ShipSimuRegistration");
+
// [EOF]
?>
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- $this->partialStub();
+ // First get a UserRegistration instance
+ $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration');
+
+ // 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();
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A user registration specially for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuRegistration extends BaseRegistration {
+ /**
+ * Private constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Ship-Simu registration class");
+
+ // Create unique ID number
+ $this->createUniqueID();
+ }
+
+ /**
+ * Create a new instance
+ *
+ * @return $registrationInstance An instance of this registration class
+ */
+ public final static function createShipSimuRegistration () {
+ // Get a new instance
+ $registrationInstance = new ShipSimuRegistration();
+
+ // And return it
+ return $registrationInstance;
+ }
+
+ /**
+ * Encrypt the given request key or throws 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));
+ }
+
+ /**
+ * Perform things like informing assigned affilates about new registration
+ * before registration
+ *
+ * @return void
+ */
+ public function doPreRegistration () {
+ $this->partialStub();
+ }
+
+ /**
+ * Registers the new user account by insterting the request data into the
+ * database and paying some start credits or throw exceptions if this fails
+ *
+ * @return void
+ */
+ public function registerNewUser () {
+ $this->partialStub();
+ }
+
+ /**
+ * Perform things like notifying partner websites after registration is done
+ *
+ * @return void
+ */
+ public function doPostRegistration () {
+ $this->partialStub();
+ }
+
+ /**
+ * Do the action which is required after all registration steps are done.
+ * This can be a simple redirect to another webpage or displaying a message
+ * to the user. Or this can be a login step into the newly created account.
+ *
+ * @return void
+ */
+ public function doPostAction () {
+ $this->partialStub();
+ }
+}
+
+//
+?>
{?header?}
<div id="main_header">
-{ship_simu_header]
+{?ship_simu_header?}
</div>
<div id="navigation">
</div>
<div id="main_footer">
-{ship_simu_footer}
+{?ship_simu_footer?}
</div>
{?footer?}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A class for user registration
+ *
+ * @author Roland Haeder <webmaster@mxchange.org>
+ * @version 0.0.0
+ * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UserRegister extends FrameworkInterface {
+ /**
+ * Encrypt the given request key or throws an exception if the key was not
+ * found in the request
+ *
+ * @param $requestKey Key in request class
+ * @return void
+ */
+ function encryptPassword ($requestKey);
+
+ /**
+ * Perform things like informing assigned affilates about new registration
+ * before registration
+ *
+ * @return void
+ */
+ function doPreRegistration ();
+
+ /**
+ * Registers the new user account by insterting the request data into the
+ * database and paying some start credits or throw exceptions if this fails
+ *
+ * @return void
+ */
+ function registerNewUser ();
+
+ /**
+ * Perform things like notifying partner websites after registration is done
+ *
+ * @return void
+ */
+ function doPostRegistration ();
+
+ /**
+ * Do the action which is required after all registration steps are done.
+ * This can be a simple redirect to another webpage or displaying a message
+ * to the user. Or this can be a login step into the newly created account.
+ *
+ * @return void
+ */
+ function doPostAction ();
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A general registration class
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.3.0
+ * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.mxchange.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseRegistration extends BaseFrameworkSystem implements UserRegister {
+ /**
+ * Instance of a request class
+ */
+ private $requestInstance = null;
+
+ /**
+ * Instance of a response class
+ */
+ private $responseInstance = null;
+
+ /**
+ * Private constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Setter for request instance
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @return void
+ */
+ public final function setRequestInstance (Requestable $requestInstance) {
+ $this->requestInstance = $requestInstance;
+ }
+
+ /**
+ * Getter for request instance
+ *
+ * @return $requestInstance An instance of a Requestable class
+ */
+ public final function getRequestInstance () {
+ return $this->requestInstance;
+ }
+
+ /**
+ * Setter for response instance
+ *
+ * @param $responseInstance An instance of a Responseable class
+ * @return void
+ */
+ public final function setResponseInstance (Responseable $responseInstance) {
+ $this->responseInstance = $responseInstance;
+ }
+
+ /**
+ * Getter for response instance
+ *
+ * @return $responseInstance An instance of a Responseable class
+ */
+ public final function getResponseInstance () {
+ return $this->responseInstance;
+ }
+}
+
+// [EOF]
+?>