More renamed
[shipsimu.git] / application / ship-simu / main / commands / web / class_WebShipsimuProfileCommand.php
index 107d093d683312d24871380a4f1e0bdecaa4d5f2..a266f2608212da15d54992ab4311494194e077d0 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A command for profile-update handling
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.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
@@ -43,7 +43,10 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
                'yahoo',
                'aol',
                'msn',
-               'rules'
+               'rules',
+               'birth_day',
+               'birth_month',
+               'birth_year'
        );
 
        /**
@@ -54,16 +57,6 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set part description
-               $this->setObjectDescription("Registration handling command for Ship-Simu");
-
-               // Create unique ID number
-               $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
@@ -72,7 +65,7 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
         * @param       $resolverInstance       An instance of a command resolver
         * @return      $commandInstance        The created command instance
         */
-       public final static function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) {
+       public static final function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) {
                // Get a new instance
                $commandInstance = new WebShipsimuProfileCommand();
 
@@ -89,14 +82,15 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
+        * @todo        Add functionality here
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Make sure only allowed values are comming through
-               foreach ($this->allowedData as $alias=>$element) {
+               foreach ($this->allowedData as $alias => $element) {
                        // Get data
                        $data = $requestInstance->getRequestElement($element);
 
-                       // Skip empty fields
+                       // Silently skip empty fields
                        if (empty($data)) continue;
 
                        // Do we have an alias?
@@ -113,7 +107,8 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
                unset($this->allowedData);
 
                // Unfinished!
-               $this->debugInstance();
+               $this->partialStub("Unfinished work.");
+               $this->debugBackTrace();
        }
 
        /**
@@ -126,22 +121,31 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Add user auth filter (we don't need an update of the user here because it will be redirected)
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
 
                // User status filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // User status if not 'guest' filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_guest_filter'));
 
                // Updated rules accepted
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
 
                // Account password validation
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+
+               // Validate CAPTCHA input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter'));
+
+               // Validate birthday input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter'));
 
                // Email changed
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter'));
 
                // Password changed
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter'));
        }
 }