]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysStartupHelpFilter.php
A lot rewrites and fixes for weak redirect methods
[shipsimu.git] / application / ship-simu / main / filter / goverment / class_ShipSimuGovermentPaysStartupHelpFilter.php
index 3d02ad9a5d843922f7e519f6177d9b69d1eef799..74ef33d0b4d502c764c9535ec708c9893478c1c2 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 ShipSimuGovermentPaysStartupHelpFilter extends BaseFrameworkSystem implements Filterable {
+3class ShipSimuGovermentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -30,21 +30,21 @@ class ShipSimuGovermentPaysStartupHelpFilter extends BaseFrameworkSystem impleme
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createShipSimuGovermentPaysStartupHelpFilter () {
+       public final static function createShipSimuGovermentPaysStartupHelpFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new ShipSimuGovermentPaysStartupHelpFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -58,11 +58,14 @@ class ShipSimuGovermentPaysStartupHelpFilter extends BaseFrameworkSystem impleme
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute the parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
                // Get the user instance from registry
                $userInstance = Registry::getRegistry()->getInstance('user');
 
                // Now simply check for it
-               if (($userInstance instanceof ManageableMember) || ($userInstance->ifGovermentPaysStartupHelp() === false)) {
+               if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovermentPaysStartupHelp() === false)) {
                        // Request is invalid
                        $requestInstance->requestIsValid(false);