class_WebShipsimuProfileCommand.php

Go to the documentation of this file.
00001 <?php
00024 class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
00028         private $requestData = array();
00029 
00033         private $allowedData = array(
00034                 'pass'  => 'pass1',
00035                 'email' => 'email1',
00036                 'surname',
00037                 'family',
00038                 'street',
00039                 'city',
00040                 'zip',
00041                 'icq',
00042                 'jabber',
00043                 'yahoo',
00044                 'aol',
00045                 'msn',
00046                 'rules'
00047         );
00048 
00054         protected function __construct () {
00055                 // Call parent constructor
00056                 parent::__construct(__CLASS__);
00057 
00058                 // Clean up a little
00059                 $this->removeNumberFormaters();
00060                 $this->removeSystemArray();
00061         }
00062 
00069         public final static function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) {
00070                 // Get a new instance
00071                 $commandInstance = new WebShipsimuProfileCommand();
00072 
00073                 // Set the resolver instance
00074                 $commandInstance->setResolverInstance($resolverInstance);
00075 
00076                 // Return the prepared instance
00077                 return $commandInstance;
00078         }
00079 
00088         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
00089                 // Make sure only allowed values are comming through
00090                 foreach ($this->allowedData as $alias => $element) {
00091                         // Get data
00092                         $data = $requestInstance->getRequestElement($element);
00093 
00094                         // Silently skip empty fields
00095                         if (empty($data)) continue;
00096 
00097                         // Do we have an alias?
00098                         if (is_string($alias)) {
00099                                 // Yes, so use it
00100                                 $this->requestData[$alias]   = $data;
00101                         } else {
00102                                 // No, default entry
00103                                 $this->requestData[$element] = $data;
00104                         }
00105                 } // END - foreach
00106 
00107                 // Remove the array, we don't need it anymore
00108                 unset($this->allowedData);
00109 
00110                 // Unfinished!
00111                 $this->partialStub("Unfinished work.");
00112                 $this->debugBackTrace();
00113         }
00114 
00123         public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
00124                 // Add user auth filter (we don't need an update of the user here because it will be redirected)
00125                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
00126 
00127                 // User status filter
00128                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
00129 
00130                 // Updated rules accepted
00131                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
00132 
00133                 // Account password validation
00134                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
00135 
00136                 // Validate CAPTCHA input
00137                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter'));
00138 
00139                 // Validate birthday input
00140                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter'));
00141 
00142                 // Email changed
00143                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter'));
00144 
00145                 // Password changed
00146                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter'));
00147         }
00148 }
00149 
00150 // [EOF]
00151 ?>

Generated on Mon Dec 8 01:06:44 2008 for Ship-Simulator by  doxygen 1.5.6