]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/commands/web/class_WebRefillFormCommand.php
No controller instances are now passed to filters
[shipsimu.git] / application / ship-simu / main / commands / web / class_WebRefillFormCommand.php
index 9039d56e8718b2f9241d564f62c0ef543c84f8a7..5cae379a6f29333aaab4ca0ebc6e201e3553723e 100644 (file)
@@ -21,7 +21,7 @@
  * 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 WebMoneyRefillFormCommand extends BaseCommand implements Commandable {
+class WebRefillFormCommand extends BaseCommand implements Commandable {
        /**
         * Protected constructor
         *
@@ -42,9 +42,9 @@ class WebMoneyRefillFormCommand extends BaseCommand implements Commandable {
         * @param       $resolverInstance       An instance of a command resolver
         * @return      $commandInstance        The created command instance
         */
-       public final static function createWebMoneyRefillFormCommand (CommandResolver $resolverInstance) {
+       public final static function createWebRefillFormCommand (CommandResolver $resolverInstance) {
                // Get a new instance
-               $commandInstance = new WebMoneyRefillFormCommand();
+               $commandInstance = new WebRefillFormCommand();
 
                // Set the resolver instance
                $commandInstance->setResolverInstance($resolverInstance);
@@ -74,19 +74,28 @@ class WebMoneyRefillFormCommand 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'));
 
                // Add user status filter here
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
 
                // Is the refill page active?
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
+
+               // Verify password
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
 
                // Verify CAPTCHA code
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
 
                // Verify refill request
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter'));
+
+               // Prepare a filter based on the requested type we shall refill
+               $filterName = sprintf("refill_request_%s_book_filter", $requestInstance->getRequestElement('type'));
+
+               // Now, try to load that filter
+               $controllerInstance->addPostFilter(ObjectFactory::createObjectByConfiguredName($filterName));
        }
 }