a399674deb9ce269d8f5ee254b3bb2bb05fad318
[shipsimu.git] / application / ship-simu / main / commands / web / government / class_WebShipsimuGovernmentTrainingCommand.php
1 <?php
2 /**
3  *
4  * @author              Roland Haeder <webmaster@ship-simu.org>
5  * @version             0.0.0
6  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
7  * @license             GNU GPL 3.0 or any newer version
8  * @link                http://www.ship-simu.org
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 class WebShipsimuGovernmentTrainingCommand extends BaseCommand implements Commandable {
24         /**
25          * Protected constructor
26          *
27          * @return      void
28          */
29         protected function __construct () {
30                 // Call parent constructor
31                 parent::__construct(__CLASS__);
32         }
33
34         /**
35          * Creates an instance of this class
36          *
37          * @param       $resolverInstance       An instance of a command resolver class
38          * @return      $commandInstance        An instance a prepared command class
39          */
40         public final static function createWebShipsimuGovernmentTrainingCommand (CommandResolver $resolverInstance) {
41                 // Get new instance
42                 $commandInstance = new WebShipsimuGovernmentTrainingCommand();
43
44                 // Set the application instance
45                 $commandInstance->setResolverInstance($resolverInstance);
46
47                 // Return the prepared instance
48                 return $commandInstance;
49         }
50
51         /**
52          * Executes the given command with given request and response objects
53          *
54          * @param       $requestInstance        An instance of a class with an Requestable interface
55          * @param       $responseInstance       An instance of a class with an Responseable interface
56          * @return      void
57          * @todo        0% done
58          */
59         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
60                 $this->partialStub('Unfinished method.');
61         }
62
63         /**
64          * Adds extra filters to the given controller instance
65          *
66          * @param       $controllerInstance             A controller instance
67          * @param       $requestInstance                An instance of a class with an Requestable interface
68          * @return      void
69          * @todo        Maybe we need some filters here?
70          */
71         public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
72                 // Add user auth filter (we don't need an update of the user here because it will be redirected)
73                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
74
75                 // Add user status filter here
76                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
77
78                 // Check if government can pay training help
79                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter'));
80
81                 // Verify password
82                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
83
84                 // Verify CAPTCHA code
85                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
86         }
87 }
88
89 // [EOF]
90 ?>