* 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
*
* @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);
*/
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', array($controllerInstance)));
// Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Is the refill page active?
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter', array($controllerInstance)));
+
+ // Verify password
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance)));
// Verify CAPTCHA code
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter', array($controllerInstance)));
// Verify refill request
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter', array($controllerInstance)));
+
+ // 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));
}
}