application/ship-simu/main/actions/web/.htaccess -text
application/ship-simu/main/actions/web/class_WebShipSimuLogin -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php -text
+application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php -text
+application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php -text
application/ship-simu/main/bank/.htaccess -text
application/ship-simu/main/bank/class_MoneyBank.php -text
application/ship-simu/main/class_ -text
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
- * @todo Maybe add fetching company list of current user here?
+ * @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Unfinished method
* @param $controllerInstance A controller instance
* @param $requestInstance An instance of a class with an Requestable interface
* @return void
+ * @todo Add some filters here
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
- // Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ // Unfinished method
}
}
* @param $controllerInstance A controller instance
* @param $requestInstance An instance of a class with an Requestable interface
* @return void
+ * @todo Add some filters here
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
- // Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ // Unfinished method
}
}
--- /dev/null
+<?php
+/**
+ * An action for logout
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 WebShipSimuLoginLogoutAction extends BaseAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @param $resolverInstance An instance of an action resolver
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function createWebShipSimuLoginLogoutAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new WebShipSimuLoginLogoutAction();
+
+ // Set the resolver instance
+ $actionInstance->setResolverInstance($resolverInstance);
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Unfinished method
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ }
+}
+
+// [EOF]
+?>
* @return void
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
- // Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
-
// Is the refill page active?
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
--- /dev/null
+<?php
+/**
+ * An action for the welcome page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 WebShipSimuLoginWelcomeAction extends BaseAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @param $resolverInstance An instance of an action resolver
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function createWebShipSimuLoginWelcomeAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new WebShipSimuLoginWelcomeAction();
+
+ // Set the resolver instance
+ $actionInstance->setResolverInstance($resolverInstance);
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Unfinished method
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Unfinished method
+ }
+}
+
+// [EOF]
+?>
*/
public function __construct(array $msgArray, $code) {
// Prepare the message
- $message = sprintf("[%s:%d] Cannot resolve action <span class=\"exception_reason\">%s</span>.",
+ $message = sprintf("[%s:%d] Cannot resolve action <span class=\"exception_reason\">%s (%s)</span>.",
$msgArray[0]->__toString(),
$this->getLine(),
- $msgArray[1]
+ $msgArray[1],
+ $msgArray[0]->getClassName()
);
// Call parent contructor with message
// End here
exit;
} // END - if
-
// Make sure everything is assigned properly
parent::__construct($message, $code);
+
+ // Log it away if DEBUG_ALL is set
+ if (defined('DEBUG_ALL')) {
+ // Log the error
+ error_log(sprintf("[%s:] %s (%s)",
+ $this->__toString(),
+ $message,
+ $this->getHexCode()
+ ));
+ } // END - if
}
/**
}
/**
- * Adds extra filters to the given controller instance
+ * Adds extra filters to the given controller instance. An corresponding action class must now exist!
*
* @param $controllerInstance A controller instance
* @param $requestInstance An instance of a class with an Requestable interface
// Get application instance
$applicationInstance = $this->getResolverInstance()->getApplicationInstance();
- // Try to get an action resolver for the given action
- try {
- // Get a resolver
- $actionResolver = WebActionResolver::createWebActionResolver($this->actionName, $applicationInstance);
+ // Get a resolver
+ $actionResolver = WebActionResolver::createWebActionResolver($this->actionName, $applicationInstance);
- // Resolve the action
- $actionInstance = $actionResolver->resolveAction();
+ // Resolve the action
+ $actionInstance = $actionResolver->resolveAction();
- // Add more action-specific filters
- $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
+ // Add more action-specific filters
+ $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
- // Remember this action in registry
- Registry::getRegistry()->addInstance('action', $actionInstance);
- } catch (InvalidActionException $e) {
- // Silently ignored because no special action was found
- }
+ // Remember this action in registry
+ Registry::getRegistry()->addInstance('action', $actionInstance);
}
}
// Set the command resolver
$controllerInstance->setResolverInstance($resolverInstance);
+ // 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_filter'));
+
+ // Check for user status by default
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
// Return the prepared instance
return $controllerInstance;
}
* "Loads" current action and instances it if not yet cached
*
* @return $actionInstance A loaded action instance
- * @throws InvalidActionException Thrown if even the default
- * action class is missing (bad!)
*/
protected function loadAction () {
// Init action instance