class_ShipSimuGovernmentPaysStartupHelpFilter.php

Go to the documentation of this file.
00001 <?php
00024 class ShipSimuGovernmentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable {
00030         protected function __construct () {
00031                 // Call parent constructor
00032                 parent::__construct(__CLASS__);
00033         }
00034 
00040         public final static function createShipSimuGovernmentPaysStartupHelpFilter () {
00041                 // Get a new instance
00042                 $filterInstance = new ShipSimuGovernmentPaysStartupHelpFilter();
00043 
00044                 // Return the instance
00045                 return $filterInstance;
00046         }
00047 
00056         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
00057                 // Execute the parent execute method
00058                 parent::execute($requestInstance, $responseInstance);
00059 
00060                 // Get the user instance from registry
00061                 $userInstance = Registry::getRegistry()->getInstance('user');
00062 
00063                 // Now simply check for it
00064                 if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysStartupHelp() === false)) {
00065                         // Request is invalid
00066                         $requestInstance->requestIsValid(false);
00067 
00068                         // Redirect to configured URL
00069                         $responseInstance->redirectToConfiguredUrl('login_government_startup_failed_url');
00070 
00071                         // Stop processing here
00072                         exit();
00073                 } // END - if
00074         }
00075 }
00076 
00077 // [EOF]
00078 ?>

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