inc/classes.php -text
inc/classes/.htaccess -text
inc/classes/exceptions/.htaccess -text
+inc/classes/exceptions/actions/.htaccess -text
+inc/classes/exceptions/actions/class_InvalidActionException.php -text
inc/classes/exceptions/auth/.htaccess -text
inc/classes/exceptions/auth/class_UserAuthorizationException.php -text
inc/classes/exceptions/class_ -text
inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php -text
inc/classes/exceptions/controller/.htaccess -text
inc/classes/exceptions/controller/class_DefaultControllerException.php -text
+inc/classes/exceptions/controller/class_InvalidControllerException.php -text
inc/classes/exceptions/criteria/.htaccess -text
inc/classes/exceptions/database/.htaccess -text
inc/classes/exceptions/database/class_DatabaseException.php -text
inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php -text
inc/classes/exceptions/template/class_ViewHelperNotFoundException.php -text
inc/classes/exceptions/user/.htaccess -text
+inc/classes/exceptions/user/class_AccountPasswordMismatchException.php -text
inc/classes/exceptions/user/class_UserEmailMissingException.php -text
inc/classes/exceptions/user/class_UserPasswordMismatchException.php -text
inc/classes/exceptions/user/class_UsernameMissingException.php -text
inc/classes/interfaces/.htaccess -text
inc/classes/interfaces/actions/.htaccess -text
inc/classes/interfaces/actions/class_PerformableAction.php -text
+inc/classes/interfaces/actions/commands/.htaccess -text
+inc/classes/interfaces/actions/commands/class_Commandable.php -text
inc/classes/interfaces/application/.htaccess -text
inc/classes/interfaces/application/class_ManageableApplication.php -text
inc/classes/interfaces/auth/.htaccess -text
inc/classes/interfaces/cache/class_Cacheable.php -text
inc/classes/interfaces/class_ -text
inc/classes/interfaces/class_FrameworkInterface.php -text
-inc/classes/interfaces/commands/.htaccess -text
-inc/classes/interfaces/commands/class_Commandable.php -text
inc/classes/interfaces/compressor/.htaccess -text
inc/classes/interfaces/compressor/class_Compressor.php -text
inc/classes/interfaces/controller/.htaccess -text
inc/classes/interfaces/request/.htaccess -text
inc/classes/interfaces/request/class_Requestable.php -text
inc/classes/interfaces/resolver/.htaccess -text
+inc/classes/interfaces/resolver/actions/.htaccess -text
+inc/classes/interfaces/resolver/actions/class_ActionResolver.php -text
inc/classes/interfaces/resolver/class_CommandResolver.php -text
inc/classes/interfaces/resolver/class_ControllerResolver.php -text
+inc/classes/interfaces/resolver/class_Resolver.php -text
+inc/classes/interfaces/resolver/commands/.htaccess -text
+inc/classes/interfaces/resolver/commands/class_CommandResolver.php -text
+inc/classes/interfaces/resolver/controller/.htaccess -text
+inc/classes/interfaces/resolver/controller/class_ControllerResolver.php -text
inc/classes/interfaces/response/.htaccess -text
inc/classes/interfaces/response/class_Responseable.php -text
inc/classes/interfaces/result/.htaccess -text
inc/classes/main/actions/class_BaseAction.php -text
inc/classes/main/actions/post_registration/.htaccess -text
inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php -text
+inc/classes/main/actions/web/.htaccess -text
+inc/classes/main/actions/web/class_WebLoginProfileAction.php -text
inc/classes/main/auth/.htaccess -text
inc/classes/main/auth/class_CookieAuth.php -text
inc/classes/main/cache/.htaccess -text
inc/classes/main/filter/validator/class_PasswordValidatorFilter.php -text
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php -text
inc/classes/main/filter/verifier/.htaccess -text
+inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php -text
inc/classes/main/filter/verifier/class_EmailValidatorFilter.php -text
inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php -text
inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php -text
inc/classes/main/helper/.htaccess -text
inc/classes/main/helper/class_ -text
inc/classes/main/helper/class_BaseHelper.php -text
inc/classes/main/request/.htaccess -text
inc/classes/main/request/class_HttpRequest.php -text
inc/classes/main/resolver/.htaccess -text
+inc/classes/main/resolver/action/.htaccess -text
+inc/classes/main/resolver/action/class_BaseActionResolver.php -text
+inc/classes/main/resolver/action/web/.htaccess -text
+inc/classes/main/resolver/action/web/class_WebActionResolver.php -text
inc/classes/main/resolver/class_BaseResolver.php -text
-inc/classes/main/resolver/web/.htaccess -text
-inc/classes/main/resolver/web/class_WebCommandResolver.php -text
-inc/classes/main/resolver/web/class_WebControllerResolver.php -text
+inc/classes/main/resolver/command/.htaccess -text
+inc/classes/main/resolver/command/class_BaseCommandResolver.php -text
+inc/classes/main/resolver/command/class_WebCommandResolver.php -text
+inc/classes/main/resolver/command/web/.htaccess -text
+inc/classes/main/resolver/command/web/class_WebCommandResolver.php -text
+inc/classes/main/resolver/controller/.htaccess -text
+inc/classes/main/resolver/controller/class_BaseControllerResolver.php -text
+inc/classes/main/resolver/controller/web/.htaccess -text
+inc/classes/main/resolver/controller/web/class_WebControllerResolver.php -text
inc/classes/main/response/.htaccess -text
inc/classes/main/response/class_HttpResponse.php -text
inc/classes/main/result/.htaccess -text
$this->setResponseInstance($responseInstance);
// Get the parameter from the request
- $commandName = $requestInstance->getRequestElement("page");
+ $commandName = $requestInstance->getRequestElement('page');
// If it is null then get default command
if (is_null($commandName)) {
$resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this);
// Get a controller instance as well
- $this->controllerInstance = $resolverInstance->resolveCommandController();
+ $this->controllerInstance = $resolverInstance->resolveController();
// Handle the request
$this->controllerInstance->handleRequest($requestInstance, $responseInstance);
$cfg->setConfigEntry('guest_login_class', "ShipSimuGuestLogin");
// CFG: USER-STATUS-REGISTER
-$cfg->setConfigEntry('user_status_register', "UNCONFIRMED");
+$cfg->setConfigEntry('user_status_unconfirmed', "UNCONFIRMED");
-// CFG: GUEST-STATUS
+// CFG: USER-STATUS-GUEST
$cfg->setConfigEntry('user_status_guest', "GUEST");
+// CFG: USER-STATUS-CONFIRMED
+$cfg->setConfigEntry('user_status_confirmed', "CONFIRMED");
+
// CFG: LOGIN-HELPER
$cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper");
// CFG: LOGOUT-DONE-URL
$cfg->setConfigEntry('logout_done_url', "index.php?app=ship-simu&page=logout_done");
+// CFG: LOGIN-USER-STATUS-URL
+$cfg->setConfigEntry('login_user_status_url', "index.php?app=ship-simu&page=login_status_problem");
+
// CFG: LOGIN-DEFAULT-ACTION
$cfg->setConfigEntry('login_default_action', "welcome");
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Which login type do we have?
switch ($this->getConfigInstance()->readConfig('login_type')) {
case "username": // Login via username
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ 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'));
/* @TODO Add some more pre/post filters to the controller */
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_class'));
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_class'));
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_class'));
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
/* @TODO Add some more pre/post filters to the controller */
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_class'));
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_class'));
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Which login type do we have?
switch ($this->getConfigInstance()->readConfig('login_type')) {
case "username": // Login via username
*/
public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
// Default is user account!
- $configEntry = 'user_status_register';
+ $configEntry = 'user_status_unconfirmed';
// Add a lot elements to the dataset criteria
foreach ($this->criteriaElements as $alias=>$element) {
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * This exception is thrown when a requested action is invalid
+ *
+ * @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 InvalidActionException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $msgArray An array with message parts
+ * @param $code An optional code for better debugging
+ * @return void
+ */
+ public function __construct(array $msgArray, $code) {
+ // Prepare the message
+ $message = sprintf("[%s:%d] Cannot resolve action <u>%s</u>.",
+ $msgArray[0]->__toString(),
+ $this->getLine(),
+ $msgArray[1]
+ );
+
+ // Call parent contructor with message
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * This exception is thrown when the default controller is missing
+ *
+ * @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 InvalidControllerException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $msgArray An array with message parts
+ * @param $code An optional code for better debugging
+ * @return void
+ */
+ public function __construct(array $msgArray, $code) {
+ // Prepare the message
+ $message = sprintf("[%s:%d] Cannot resolve controller <u>%s</u>.",
+ $msgArray[0]->__toString(),
+ $this->getLine(),
+ $msgArray[1]
+ );
+
+ // Call parent contructor with message
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A class for mismatching passwords
+ *
+ * @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 AccountPasswordMismatchException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $filterInstance A filterable class instance
+ * @param $code An optional code for better debugging
+ * @return void
+ */
+ public function __construct(Filterable $filterInstance, $code) {
+ // Create the message
+ $message = sprintf("[%s:%d] Supplied account password did not match with stored.",
+ $filterInstance->__toString(),
+ $this->getLine()
+ );
+
+ // Make sure everything is assigned properly
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for commands for the front controller
+ *
+ * @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/>.
+ */
+interface Commandable extends PerformableAction {
+ /**
+ * 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
+ */
+ function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance);
+}
+
+//
+?>
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * An interface for commands for the front controller
- *
- * @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/>.
- */
-interface Commandable extends FrameworkInterface {
- /**
- * 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
- */
- function execute (Requestable $requestInstance, Responseable $responseInstance);
-
- /**
- * Adds extra filters to the given controller instance
- *
- * @param $controllerInstance A controller instance
- * @return void
- */
- function addExtraFilters (Controller $controllerInstance);
-}
-
-//
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An instance for action resolver classes
+ *
+ * @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/>.
+ */
+interface ActionResolver extends Resolver {
+ /**
+ * Returns an action instance for the current action
+ *
+ * @return $actionInstance An instance of the resolved action
+ */
+ function resolveAction ();
+
+ /**
+ * Returns an action instance for a given request class
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $actionInstance An instance of the resolved action
+ */
+ function resolveActionByRequest (Requestable $requestInstance);
+
+ /**
+ * Checks wether the given action is valid
+ *
+ * @param $actionName The default action we shall execute
+ * @return $isValid Wether the given action is valid
+ * @throws EmptyVariableException Thrown if the given action is not set
+ */
+ function isActionValid ($actionName);
+}
+
+//
+?>
--- /dev/null
+<?php
+/**
+ * An interface for all resolvers
+ *
+ * @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/>.
+ */
+interface Resolver extends FrameworkInterface {
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An instance for command resolver classes
+ *
+ * @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/>.
+ */
+interface CommandResolver extends Resolver {
+ /**
+ * Returns an command instance for a given request class
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $commandInstance An instance of the resolved command
+ */
+ function resolveCommandByRequest (Requestable $requestInstance);
+
+ /**
+ * Checks wether the given command is valid
+ *
+ * @param $commandName The default command we shall execute
+ * @return $isValid Wether the given command is valid
+ * @throws EmptyVariableException Thrown if the given command is not set
+ */
+ function isCommandValid ($commandName);
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An instance for controller resolver classes
+ *
+ * @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/>.
+ */
+interface ControllerResolver extends Resolver {
+ /**
+ * Resolves the default controller of the given command
+ *
+ * @return $controllerInstance A controller instance for the default command
+ */
+ function resolveController ();
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An action for the profile page in login area
+ *
+ * @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 WebLoginProfileAction extends BaseAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set description
+ $this->setObjectDescription("Web profile action");
+
+ // Generate unique key
+ $this->generateUniqueId();
+ }
+
+ /**
+ * 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 createWebLoginProfileAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new WebLoginProfileAction();
+
+ // 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
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Dummy 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) {
+ // Add user status filter here
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+ }
+}
+
+// [EOF]
+?>
*/
private $searchInstance = null;
+ /**
+ * The file I/O instance for the template loader
+ */
+ private $fileIoInstance = null;
+
+ /**
+ * Resolver instance
+ */
+ private $resolverInstance = null;
+
/**
* The real class name
*/
*/
private $decimals = ","; // German
- /**
- * The file I/O instance for the template loader
- */
- private $fileIoInstance = null;
-
/***********************
* Exception codes.... *
***********************/
const EXCEPTION_MISSING_LANGUAGE_HANDLER = 0x02e;
const EXCEPTION_MISSING_FILE_IO_HANDLER = 0x02f;
const EXCEPTION_MISSING_ELEMENT = 0x030;
- const EXCEPTION_INVALID_COMMAND = 0x031;
- const EXCEPTION_INVALID_CONTROLLER = 0x032;
- const EXCEPTION_HEADERS_ALREADY_SENT = 0x033;
- const EXCEPTION_DEFAUL_CONTROLLER_GONE = 0x034;
- const EXCEPTION_CLASS_NOT_FOUND = 0x035;
- const EXCEPTION_REQUIRED_INTERFACE_MISSING = 0x036;
- const EXCEPTION_FATAL_ERROR = 0x037;
- const EXCEPTION_FILE_NOT_FOUND = 0x038;
+ const EXCEPTION_HEADERS_ALREADY_SENT = 0x031;
+ const EXCEPTION_DEFAUL_CONTROLLER_GONE = 0x032;
+ const EXCEPTION_CLASS_NOT_FOUND = 0x033;
+ const EXCEPTION_REQUIRED_INTERFACE_MISSING = 0x034;
+ const EXCEPTION_FATAL_ERROR = 0x035;
+ const EXCEPTION_FILE_NOT_FOUND = 0x036;
/**
* In the super constructor these system classes shall be ignored or else
public final function getSearchInstance () {
return $this->searchInstance;
}
+
+ /**
+ * Setter for resolver instance
+ *
+ * @param $resolverInstance Instance of a command resolver class
+ * @return void
+ */
+ public final function setResolverInstance (Resolver $resolverInstance) {
+ $this->resolverInstance = $resolverInstance;
+ }
+
+ /**
+ * Getter for resolver instance
+ *
+ * @return $resolverInstance Instance of a command resolver class
+ */
+ public final function getResolverInstance () {
+ return $this->resolverInstance;
+ }
}
// [EOF]
*/
private $controllerName = "";
- /**
- * Resolver instance
- */
- private $resolverInstance = null;
-
/**
* Protected constructor
*
public final function getControllerName () {
return $this->controllerName;
}
-
- /**
- * Setter for resolver instance
- *
- * @param $resolverInstance Instance of a command resolver class
- * @return void
- */
- public final function setResolverInstance (CommandResolver $resolverInstance) {
- $this->resolverInstance = $resolverInstance;
- }
-
- /**
- * Getter for resolver instance
- *
- * @return $resolverInstance Instance of a command resolver class
- */
- public final function getResolverInstance () {
- return $this->resolverInstance;
- }
}
// [EOF]
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
}
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class WebLoginAreaCommand extends BaseCommand implements Commandable {
+ /**
+ * Name of the action
+ */
+ private $actionName = "";
+
/**
* Protected constructor
*
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Default action is the one from configuration
- $actionClass = sprintf("login_%s_action_class", $this->getConfigInstance()->readConfig('login_default_action'));
- $action = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action'));
-
- // Get "action" from request
- $actReq = $requestInstance->getRequestElement('action');
-
- // Do we have a "action" parameter set?
- if (is_string($actReq)) {
- // Then use it with prefix
- $actionClass = sprintf("login_%s_action_class", $actReq);
- $action = sprintf("login_%s", $actReq);
- } // END - if
-
- // Get an action instance
- $actionInstance = ObjectFactory::createObjectByConfiguredName($actionClass);
+ // Get the action instance from registry
+ $actionInstance = Registry::getRegistry()->getInstance('action');
// Execute the action (shall not output anything, see below why)
$actionInstance->execute($requestInstance, $responseInstance);
$templateInstance->assignTemplateWithVariable("footer", "footer");
// Load the matching template
- $templateInstance->loadCodeTemplate($action);
+ $templateInstance->loadCodeTemplate($this->actionName);
// Assign the template with the master template as a content ... ;)
$templateInstance->compileTemplate();
- $templateInstance->assignTemplateWithVariable($action, "login_content");
+ $templateInstance->assignTemplateWithVariable($this->actionName, "login_content");
// Load main template
$templateInstance->loadCodeTemplate("login_main");
$templateInstance->loadCodeTemplate($masterTemplate);
// Set title
- $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($action."_title"));
+ $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($this->actionName."_title"));
// ... and all variables. This should be merged together in a pattern
// to make things easier. A cache mechanism should be added between
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
- // Empty for now
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Default is no action
+ $actionInstance = null;
+
+ // Default action is the one from configuration
+ $this->actionName = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action'));
+
+ // Get "action" from request
+ $actReq = $requestInstance->getRequestElement('action');
+
+ // Do we have a "action" parameter set?
+ if ((is_string($actReq)) && (!empty($actReq))) {
+ // Then use it with prefix
+ $this->actionName = sprintf("login_%s", $actReq);
+ } // END - if
+
+ // 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);
+
+ // Resolve the action
+ $actionInstance = $actionResolver->resolveAction();
+
+ // 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
+ }
}
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
}
* 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
*/
- function addExtraFilters (Controller $controllerInstance) {
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Empty for now
}
}
* 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 BaseController extends BaseFrameworkSystem {
- /**
- * Instance of a CommandResolver class
- */
- private $resolverInstance = null;
-
+class BaseController extends BaseFrameworkSystem implements Registerable {
/**
* Pre filter chain instance
*/
// Initialize both filter chains
$this->preFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
$this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
- }
- /**
- * Getter for a command resolver instance
- *
- * @return $resolverInstance An instance of a command resolver class
- */
- public final function getResolverInstance () {
- return $this->resolverInstance;
- }
-
- /**
- * Setter for a command resolver instance
- *
- * @param $resolverInstance An instance of a command resolver class
- * @return void
- */
- public final function setResolverInstance (CommandResolver $resolverInstance) {
- $this->resolverInstance = $resolverInstance;
+ // Add this controller to the registry
+ Registry::getRegistry()->addInstance('controller', $this);
}
/**
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance
- $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
$requestInstance->requestIsValid();
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance from the resolver by sending a request instance to the resolver
- $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// Add more filters by the command
- $commandInstance->addExtraFilters($this);
+ $commandInstance->addExtraFilters($this, $requestInstance);
// Run the pre filters
$this->executePreFilters($requestInstance, $responseInstance);
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance from the resolver by sending a request instance to the resolver
- $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// Add more filters by the command
- $commandInstance->addExtraFilters($this);
+ $commandInstance->addExtraFilters($this, $requestInstance);
// Run the pre filters
$this->executePreFilters($requestInstance, $responseInstance);
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance
- $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
$requestInstance->requestIsValid();
$commandInstance = $this->getResolverInstance()->resolveCommand($formAction);
// Add more filters by the command
- $commandInstance->addExtraFilters($this);
+ $commandInstance->addExtraFilters($this, $requestInstance);
// Try to run the pre filters, if auth exceptions come through redirect here
try {
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance from the resolver by sending a request instance to the resolver
- $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// Add more filters by the command
- $commandInstance->addExtraFilters($this);
+ $commandInstance->addExtraFilters($this, $requestInstance);
// Try to run the pre filters, if auth exceptions come through redirect here
try {
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Implement this!
- $this->partialStub("Please implement this method.");
+ // Get both emails
+ $email1 = $requestInstance->getRequestElement('email1');
+ $email2 = $requestInstance->getRequestElement('email2');
+
+ // Is only first email set?
+ if ((!empty($email1)) && (empty($email2))) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Email 2 is empty
+ $responseInstance->addFatalMessage('email2_empty');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Is only second email set?
+ if ((empty($email1)) && (!empty($email2))) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Email 1 is empty
+ $responseInstance->addFatalMessage('email1_empty');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Do both match?
+ if ($email1 != $email2) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Emails are mismatching
+ $responseInstance->addFatalMessage('emails_mismatch');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Now, get a user instance for comparison
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Get the email field
+ $userEmail = $userInstance->getField('email');
+
+ // Are they different?
+ if ($email != $email1) {
+ // Update the "new_email" field
+ $this->partialStub("Unfinished part.");
+ } // END - if
}
}
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Implement this!
- $this->partialStub("Please implement this method.");
+ // Get both passwords
+ $pass1 = $requestInstance->getRequestElement('pass1');
+ $pass2 = $requestInstance->getRequestElement('pass2');
+
+ // Is only first email set?
+ if ((!empty($pass1)) && (empty($pass2))) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Email 2 is empty
+ $responseInstance->addFatalMessage('pass2_empty');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Is only second pass set?
+ if ((empty($pass1)) && (!empty($pass2))) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Email 1 is empty
+ $responseInstance->addFatalMessage('pass1_empty');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Do both match?
+ if ($pass1 != $pass2) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Emails are mismatching
+ $responseInstance->addFatalMessage('pass_mismatch');
+
+ // Stop processing here
+ return false;
+ } // END - if
+
+ // Now, get a user instance for comparison
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Update the "password" field
+ $this->partialStub("Unfinished part.");
}
}
// Is the password empty?
if (empty($password1)) {
// Add a message to the response
- $responseInstance->addFatalMessage('password1_empty');
+ $responseInstance->addFatalMessage('pass1_empty');
} // END - if
// Is the confirmation empty?
if (empty($password2)) {
// Add a message to the response
- $responseInstance->addFatalMessage('password2_empty');
+ $responseInstance->addFatalMessage('pass2_empty');
} // END - if
// Abort here
$requestInstance->requestIsValid(false);
// Add a message to the response
- $responseInstance->addFatalMessage('passwords_mismatching');
+ $responseInstance->addFatalMessage('pass_mismatch');
// Abort here
return false;
--- /dev/null
+<?php
+/**
+ * A concrete filter for validating the password. This filter may intercept
+ * the filter chain if no password is given or the password is invalid
+ *
+ * @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 AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for account password verification");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createAccountPasswordVerifierFilter () {
+ // Get a new instance
+ $filterInstance = new AccountPasswordVerifierFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter 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
+ * @throws AccountPasswordMismatchException If the account password does not match
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get password
+ $password = $requestInstance->getRequestElement('pass_old');
+
+ // Is the password still not set?
+ if (is_null($password)) {
+ // Not found in form so stop the filtering process
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('pass_old_unset');
+
+ // Abort here
+ return false;
+ } elseif (empty($password)) {
+ // Password is empty
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('pass_old_empty');
+
+ // Abort here
+ return false;
+ }
+
+ // Get a user instance
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Get old hash
+ $oldHash = $userInstance->getField('pass_hash');
+
+ // Get an encryption helper and encrypt the password
+ $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashPassword($password, $oldHash);
+
+ // Does it match?
+ if ($oldHash != $passHash) {
+ // Throw an exception here to stop the proccessing
+ throw new AccountPasswordMismatchException($this, User::EXCEPTION_USER_PASS_MISMATCH);
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A filter for checking if the user status is GUEST or CONFIRMED
+ *
+ * @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 UserStatusVerifierFilter extends BaseFrameworkSystem implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for email changes");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createUserStatusVerifierFilter () {
+ // Get a new instance
+ $filterInstance = new UserStatusVerifierFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter 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
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get a user instance for comparison
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Is the user account confirmed?
+ if (($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_confirmed')) && ($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_guest'))) {
+ // Request is invalid!
+ $requestInstance->requestIsValid(false);
+
+ // Redirect to configured URL
+ $responseInstance->redirectToConfiguredUrl('login_user_status_url');
+
+ // Stop processing here
+ exit();
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A generic action resolver class
+ *
+ * @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 BaseActionResolver extends BaseResolver {
+ /**
+ * Prefix for local, remote or other resolver
+ */
+ private $actionPrefix = "";
+
+ /**
+ * Validated action name
+ */
+ private $actionName = "";
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Setter for action prefix
+ *
+ * @param $actionPrefix Last validated actionPrefix
+ * @return void
+ */
+ protected final function setActionPrefix ($actionPrefix) {
+ $this->actionPrefix = $actionPrefix;
+ }
+
+ /**
+ * Setter for action name
+ *
+ * @param $actionName Last validated action name
+ * @return void
+ */
+ protected final function setActionName ($actionName) {
+ $this->actionName = $actionName;
+ }
+
+ /**
+ * Getter for action name
+ *
+ * @return $actionName Last validated action name
+ */
+ protected final function getActionName () {
+ return $this->actionName;
+ }
+
+ /**
+ * Checks wether the given action is valid
+ *
+ * @param $actionName The default action we shall execute
+ * @return $isValid Wether the given action is valid
+ * @throws EmptyVariableException Thrown if the given action is not set
+ */
+ public function isActionValid ($actionName) {
+ // By default nothing shall be valid
+ $isValid = false;
+
+ // Is a action set?
+ if (empty($actionName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } // END - if
+
+ // Now, let us create the full name of the action class
+ $className = sprintf("%s%sAction",
+ $this->actionPrefix,
+ $this->convertToClassName($actionName)
+ );
+
+ // Is this class already loaded?
+ if (class_exists($className)) {
+ // This class does exist. :-)
+ $isValid = true;
+ } // END - if
+
+ // Debug output
+ //* DEBUG: */ $this->debugBacktrace();
+
+ // Set action name
+ $this->setActionName($actionName);
+
+ // Return the result
+ return $isValid;
+ }
+
+ /**
+ * "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
+ $actionInstance = null;
+
+ // Create action class name
+ $className = sprintf("Web%sAction",
+ $this->convertToClassName($this->getActionName())
+ );
+
+ // Initiate the action
+ $actionInstance = ObjectFactory::createObjectByName($className, array($this));
+
+ // Return the result
+ return $actionInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A action resolver for local (non-hubbed) actions
+ *
+ * @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 WebActionResolver extends BaseActionResolver implements ActionResolver {
+ /**
+ * Last successfull resolved action
+ */
+ private $lastActionInstance = "";
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Resolver for local web actions");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Set prefix to "Web"
+ $this->setActionPrefix("Web");
+ }
+
+ /**
+ * Creates an instance of a Web action resolver with a given default action
+ *
+ * @param $actionName The default action we shall execute
+ * @param $appInstance An instance of a manageable application helper class
+ * @return $resolverInstance The prepared action resolver instance
+ * @throws EmptyVariableException Thrown if the default action is not set
+ * @throws InvalidActionException Thrown if the default action is invalid
+ */
+ public final static function createWebActionResolver ($actionName, ManageableApplication $appInstance) {
+ // Create the new instance
+ $resolverInstance = new WebActionResolver();
+
+ // Is the variable $actionName set and the action is valid?
+ if (empty($actionName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } elseif (!$resolverInstance->isActionValid($actionName)) {
+ // Invalid action found
+ throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
+ }
+
+ // Set the application instance
+ $resolverInstance->setApplicationInstance($appInstance);
+
+ // Return the prepared instance
+ return $resolverInstance;
+ }
+
+ /**
+ * Returns an action instance for a given request class or null if
+ * it was not found
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $actionInstance An instance of the resolved action
+ * @throws InvalidActionException Thrown if $actionName is
+ * invalid
+ * @throws InvalidActionInstanceException Thrown if $actionInstance
+ * is an invalid instance
+ */
+ public function resolveActionByRequest (Requestable $requestInstance) {
+ // Init variables
+ $actionName = "";
+ $actionInstance = null;
+
+ // This goes fine so let's resolv the action
+ $actionName = $requestInstance->getRequestElement('action');
+
+ // Is the action empty? Then fall back to default action
+ if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+
+ // Check if the action is valid
+ if (!$this->isActionValid($actionName)) {
+ // This action is invalid!
+ throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+ } // END - if
+
+ // Get the action
+ $actionInstance = $this->loadAction();
+
+ // And validate it
+ if ((!is_object($actionInstance)) || (!$actionInstance instanceof Actionable)) {
+ // This action has an invalid instance!
+ throw new InvalidActionInstanceException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+ } // END - if
+
+ // Set last action
+ $this->lastActionInstance = $actionInstance;
+
+ // Return the resolved action instance
+ return $actionInstance;
+ }
+
+ /**
+ * Resolves the action by its direct name and returns an instance of its class
+ *
+ * @return $actionInstance An instance of the action class
+ * @throws InvalidActionException Thrown if $actionName is invalid
+ */
+ public function resolveAction () {
+ // Initiate the instance variable
+ $actionInstance = null;
+
+ // Get action name
+ $actionName = $this->getActionName();
+
+ // Is the action empty? Then fall back to default action
+ if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+
+ // Check if the action is valid
+ if (!$this->isActionValid($actionName)) {
+ // This action is invalid!
+ throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+ }
+
+ // Get the action
+ $actionInstance = $this->loadAction();
+
+ // Return the instance
+ return $actionInstance;
+ }
+}
+
+// [EOF]
+?>
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseResolver extends BaseFrameworkSystem {
- /**
- * Validated command name
- */
- private $commandName = "";
-
- /**
- * Prefix for local, remote or other resolver
- */
- private $commandPrefix = "";
-
- /**
- * A controller instance
- */
- private $controllerInstance = null;
+ // Exception constants
+ const EXCEPTION_INVALID_COMMAND = 0x0c0;
+ const EXCEPTION_INVALID_CONTROLLER = 0x0c1;
+ const EXCEPTION_INVALID_ACTION = 0x0c2;
/**
* Protected constructor
*
+ * @param $className Real name of the class
* @return void
*/
- protected function __construct ($class) {
+ protected function __construct ($className) {
// Call parent constructor
- parent::__construct($class);
+ parent::__construct($className);
// Clean up a little
$this->removeNumberFormaters();
$this->removeSystemArray();
}
-
- /**
- * Setter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @param $controllerInstance An instance of the controller
- * @return void
- */
- public final function setControllerInstance (Controller $controllerInstance) {
- $this->controllerInstance = $controllerInstance;
- }
-
- /**
- * Getter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @return $controllerInstance An instance of the controller
- */
- public final function getControllerInstance () {
- return $this->controllerInstance;
- }
-
- /**
- * Setter for command name
- *
- * @param $commandName Last validated command name
- * @return void
- */
- protected final function setCommandName ($commandName) {
- $this->commandName = $commandName;
- }
-
- /**
- * Getter for command name
- *
- * @return $commandName Last validated command name
- */
- protected final function getCommandName () {
- return $this->commandName;
- }
-
- /**
- * Setter for command prefix
- *
- * @param $commandPrefix Last validated commandPrefix
- * @return void
- */
- protected final function setCommandPrefix ($commandPrefix) {
- $this->commandPrefix = $commandPrefix;
- }
-
- /**
- * Checks wether the given command is valid
- *
- * @param $commandName The default command we shall execute
- * @return $isValid Wether the given command is valid
- * @throws EmptyVariableException Thrown if the given command is not set
- */
- public function isCommandValid ($commandName) {
- // By default nothing shall be valid
- $isValid = false;
-
- // Is a command set?
- if (empty($commandName)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- }
-
- // Now, let us create the full name of the command class
- $class = sprintf("%s%sCommand",
- $this->commandPrefix,
- $this->convertToClassName($commandName)
- );
-
- // Is this class already loaded?
- if (class_exists($class)) {
- // This class does exist. :-)
- $isValid = true;
- }
-
- // Debug output
- //* DEBUG: */ $this->debugBacktrace();
-
- // Set command name
- $this->setCommandName($commandName);
-
- // Return the result
- return $isValid;
- }
}
// [EOF]
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A generic command resolver class
+ *
+ * @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 BaseCommandResolver extends BaseResolver {
+ /**
+ * Prefix for local, remote or other resolver
+ */
+ private $commandPrefix = "";
+
+ /**
+ * Validated command name
+ */
+ private $commandName = "";
+
+ /**
+ * A controller instance
+ */
+ private $controllerInstance = null;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Setter for command prefix
+ *
+ * @param $commandPrefix Last validated commandPrefix
+ * @return void
+ */
+ protected final function setCommandPrefix ($commandPrefix) {
+ $this->commandPrefix = $commandPrefix;
+ }
+
+ /**
+ * Setter for command name
+ *
+ * @param $commandName Last validated command name
+ * @return void
+ */
+ protected final function setCommandName ($commandName) {
+ $this->commandName = $commandName;
+ }
+
+ /**
+ * Getter for command name
+ *
+ * @return $commandName Last validated command name
+ */
+ protected final function getCommandName () {
+ return $this->commandName;
+ }
+
+ /**
+ * Setter for controller instance (this surely breaks a bit the MVC patterm)
+ *
+ * @param $controllerInstance An instance of the controller
+ * @return void
+ */
+ public final function setControllerInstance (Controller $controllerInstance) {
+ $this->controllerInstance = $controllerInstance;
+ }
+
+ /**
+ * Getter for controller instance (this surely breaks a bit the MVC patterm)
+ *
+ * @return $controllerInstance An instance of the controller
+ */
+ public final function getControllerInstance () {
+ return $this->controllerInstance;
+ }
+
+ /**
+ * Checks wether the given command is valid
+ *
+ * @param $commandName The default command we shall execute
+ * @return $isValid Wether the given command is valid
+ * @throws EmptyVariableException Thrown if the given command is not set
+ */
+ public function isCommandValid ($commandName) {
+ // By default nothing shall be valid
+ $isValid = false;
+
+ // Is a command set?
+ if (empty($commandName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ }
+
+ // Now, let us create the full name of the command class
+ $className = sprintf("%s%sCommand",
+ $this->commandPrefix,
+ $this->convertToClassName($commandName)
+ );
+
+ // Is this class already loaded?
+ if (class_exists($className)) {
+ // This class does exist. :-)
+ $isValid = true;
+ } // END - if
+
+ // Debug output
+ //* DEBUG: */ $this->debugBacktrace();
+
+ // Set command name
+ $this->setCommandName($commandName);
+
+ // Return the result
+ return $isValid;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A command resolver for local (non-hubbed) commands
+ *
+ * @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 WebCommandResolver extends BaseResolver implements CommandResolver {
+ /**
+ * Last successfull resolved command
+ */
+ private $lastCommandInstance = "";
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Resolver for local web commands");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Set prefix to "Web"
+ $this->setCommandPrefix("Web");
+ }
+
+ /**
+ * Creates an instance of a Web command resolver with a given default command
+ *
+ * @param $commandName The default command we shall execute
+ * @param $appInstance An instance of a manageable application helper class
+ * @return $resolverInstance The prepared command resolver instance
+ * @throws EmptyVariableException Thrown if the default command is not set
+ * @throws InvalidCommandException Thrown if the default command is invalid
+ */
+ public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
+ // Create the new instance
+ $resolverInstance = new WebCommandResolver();
+
+ // Is the variable $commandName set and the command is valid?
+ if (empty($commandName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } elseif (!$resolverInstance->isCommandValid($commandName)) {
+ // Invalid command found
+ throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ }
+
+ // Set the application instance
+ $resolverInstance->setApplicationInstance($appInstance);
+
+ // Return the prepared instance
+ return $resolverInstance;
+ }
+
+ /**
+ * Returns an command instance for a given request class or null if
+ * it was not found
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $commandInstance An instance of the resolved command
+ * @throws InvalidCommandException Thrown if $commandName is
+ * invalid
+ * @throws InvalidCommandInstanceException Thrown if $commandInstance
+ * is an invalid instance
+ */
+ public function resolvCommandByRequest (Requestable $requestInstance) {
+ // Init variables
+ $commandName = "";
+ $commandInstance = null;
+
+ // This goes fine so let's resolv the command
+ $commandName = $requestInstance->getRequestElement("page");
+
+ // Is the command empty? Then fall back to default command
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
+
+ // Check if the command is valid
+ if (!$this->isCommandValid($commandName)) {
+ // This command is invalid!
+ throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ } // END - if
+
+ // Get the command
+ $commandInstance = $this->loadCommand($commandName);
+
+ // And validate it
+ if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+ // This command has an invalid instance!
+ throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ } // END - if
+
+ // Set last command
+ $this->lastCommandInstance = $commandInstance;
+
+ // Return the resolved command instance
+ return $commandInstance;
+ }
+
+ /**
+ * Resolves the command by its direct name and returns an instance of its class
+ *
+ * @param $commandName The direct command name we shall resolve
+ * @return $commandInstance An instance of the command class
+ * @throws InvalidCommandException Thrown if $commandName is invalid
+ */
+ public function resolveCommand ($commandName) {
+ // Initiate the instance variable
+ $commandInstance = null;
+
+ // Is the command empty? Then fall back to default command
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
+
+ // Check if the command is valid
+ if (!$this->isCommandValid($commandName)) {
+ // This command is invalid!
+ throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ }
+
+ // Get the command
+ $commandInstance = $this->loadCommand($commandName);
+
+ // Return the instance
+ return $commandInstance;
+ }
+
+ /**
+ * "Loads" a given command and instances it if not yet cached
+ *
+ * @param $commandName A command name we shall look for
+ * @return $commandInstance A loaded command instance
+ * @throws InvalidCommandException Thrown if even the default
+ * command class is missing (bad!)
+ */
+ private function loadCommand ($commandName) {
+ // Cache default command
+ $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
+
+ // Init command instance
+ $commandInstance = null;
+
+ // Create command class name
+ $className = sprintf("Web%sCommand",
+ $this->convertToClassName($commandName)
+ );
+
+ // Is this class loaded?
+ if (!class_exists($className)) {
+ // Class not found, so try the default one or throw exception
+ if ($commandName != $defaultCommand) {
+ // Try the default command
+ return $this->loadCommand($defaultCommand);
+ } else {
+ // Still not found?
+ throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+ }
+ } // END - if
+
+ // Initiate the command
+ $commandInstance = ObjectFactory::createObjectByName($className, array($this));
+
+ // Return the result
+ return $commandInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A command resolver for local (non-hubbed) commands
+ *
+ * @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 WebCommandResolver extends BaseCommandResolver implements CommandResolver {
+ /**
+ * Last successfull resolved command
+ */
+ private $lastCommandInstance = "";
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Resolver for local web commands");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Set prefix to "Web"
+ $this->setCommandPrefix("Web");
+ }
+
+ /**
+ * Creates an instance of a Web command resolver with a given default command
+ *
+ * @param $commandName The default command we shall execute
+ * @param $appInstance An instance of a manageable application helper class
+ * @return $resolverInstance The prepared command resolver instance
+ * @throws EmptyVariableException Thrown if the default command is not set
+ * @throws InvalidCommandException Thrown if the default command is invalid
+ */
+ public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
+ // Create the new instance
+ $resolverInstance = new WebCommandResolver();
+
+ // Is the variable $commandName set and the command is valid?
+ if (empty($commandName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } elseif (!$resolverInstance->isCommandValid($commandName)) {
+ // Invalid command found
+ throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ }
+
+ // Set the application instance
+ $resolverInstance->setApplicationInstance($appInstance);
+
+ // Return the prepared instance
+ return $resolverInstance;
+ }
+
+ /**
+ * Returns an command instance for a given request class or null if
+ * it was not found
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $commandInstance An instance of the resolved command
+ * @throws InvalidCommandException Thrown if $commandName is
+ * invalid
+ * @throws InvalidCommandInstanceException Thrown if $commandInstance
+ * is an invalid instance
+ */
+ public function resolveCommandByRequest (Requestable $requestInstance) {
+ // Init variables
+ $commandName = "";
+ $commandInstance = null;
+
+ // This goes fine so let's resolv the command
+ $commandName = $requestInstance->getRequestElement('page');
+
+ // Is the command empty? Then fall back to default command
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
+
+ // Check if the command is valid
+ if (!$this->isCommandValid($commandName)) {
+ // This command is invalid!
+ throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ } // END - if
+
+ // Get the command
+ $commandInstance = $this->loadCommand($commandName);
+
+ // And validate it
+ if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+ // This command has an invalid instance!
+ throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ } // END - if
+
+ // Set last command
+ $this->lastCommandInstance = $commandInstance;
+
+ // Return the resolved command instance
+ return $commandInstance;
+ }
+
+ /**
+ * Resolves the command by its direct name and returns an instance of its class
+ *
+ * @param $commandName The direct command name we shall resolve
+ * @return $commandInstance An instance of the command class
+ * @throws InvalidCommandException Thrown if $commandName is invalid
+ */
+ public function resolveCommand ($commandName) {
+ // Initiate the instance variable
+ $commandInstance = null;
+
+ // Is the command empty? Then fall back to default command
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
+
+ // Check if the command is valid
+ if (!$this->isCommandValid($commandName)) {
+ // This command is invalid!
+ throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+ }
+
+ // Get the command
+ $commandInstance = $this->loadCommand($commandName);
+
+ // Return the instance
+ return $commandInstance;
+ }
+
+ /**
+ * "Loads" a given command and instances it if not yet cached
+ *
+ * @param $commandName A command name we shall look for
+ * @return $commandInstance A loaded command instance
+ * @throws InvalidCommandException Thrown if even the default
+ * command class is missing (bad!)
+ */
+ private function loadCommand ($commandName) {
+ // Cache default command
+ $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
+
+ // Init command instance
+ $commandInstance = null;
+
+ // Create command class name
+ $className = sprintf("Web%sCommand",
+ $this->convertToClassName($commandName)
+ );
+
+ // Is this class loaded?
+ if (!class_exists($className)) {
+ // Class not found, so try the default one or throw exception
+ if ($commandName != $defaultCommand) {
+ // Try the default command
+ return $this->loadCommand($defaultCommand);
+ } else {
+ // Still not found?
+ throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+ }
+ } // END - if
+
+ // Initiate the command
+ $commandInstance = ObjectFactory::createObjectByName($className, array($this));
+
+ // Return the result
+ return $commandInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A generic controller resolver class
+ *
+ * @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 BaseControllerResolver extends BaseResolver {
+ /**
+ * Prefix for local, remote or other resolver
+ */
+ private $controllerPrefix = "";
+
+ /**
+ * Validated controller name
+ */
+ private $controllerName = "";
+
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the real class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Setter for controller prefix
+ *
+ * @param $controllerPrefix Last validated controllerPrefix
+ * @return void
+ */
+ protected final function setControllerPrefix ($controllerPrefix) {
+ $this->controllerPrefix = $controllerPrefix;
+ }
+
+ /**
+ * Setter for controller name
+ *
+ * @param $controllerName Last validated controller name
+ * @return void
+ */
+ protected final function setControllerName ($controllerName) {
+ $this->controllerName = $controllerName;
+ }
+
+ /**
+ * Getter for controller name
+ *
+ * @return $controllerName Last validated controller name
+ */
+ protected final function getControllerName () {
+ return $this->controllerName;
+ }
+
+ /**
+ * Checks wether the given controller is valid
+ *
+ * @param $controllerName The default controller we shall execute
+ * @return $isValid Wether the given controller is valid
+ * @throws EmptyVariableException Thrown if the given controller is not set
+ */
+ public function isControllerValid ($controllerName) {
+ // By default nothing shall be valid
+ $isValid = false;
+
+ // Is a controller set?
+ if (empty($controllerName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($this, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } // END - if
+
+ // Now, let us create the full name of the controller class
+ $className = sprintf("%s%sController",
+ $this->controllerPrefix,
+ $this->convertToClassName($controllerName)
+ );
+
+ // Try it hard to get an controller
+ while (!$isValid) {
+ // Is this class already loaded?
+ if (class_exists($className)) {
+ // This class does exist. :-)
+ $isValid = true;
+ } elseif (($className != "WebDefaultController") && ($className != "WebDefaultNewsController")) {
+ // Do we have news?
+ if ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
+ // Yes, display news in home then set default controller with news
+ $className = "WebDefaultNewsController";
+ } else {
+ // No news at "home" page or non-news page
+ $className = "WebDefaultController";
+ }
+ } else {
+ // All is tried, give it up here
+ throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
+ }
+ } // END - while
+
+ // Debug output
+ //* DEBUG: */ $this->debugBacktrace();
+
+ // Return the result
+ return $isValid;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A resolver for resolving controllers locally
+ *
+ * @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 WebControllerResolver extends BaseControllerResolver implements ControllerResolver {
+ /**
+ * Last successfull resolved controller (name)
+ */
+ private $lastControllerName = "";
+
+ /**
+ * Last successfull resolved controller (instance)
+ */
+ private $lastControllerInstance = null;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Resolver for local web controllers");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Set prefix to "Web"
+ $this->setControllerPrefix("Web");
+ }
+
+ /**
+ * Creates an instance of a resolver class with a given command
+ *
+ * @param $controllerName The controller we shall resolve
+ * @param $appInstance An instance of a manageable application helper class
+ * @return $resolverInstance The prepared controller resolver instance
+ * @throws EmptyVariableException Thrown if the default command is not set
+ * @throws InvalidControllerException Thrown if the default controller is invalid
+ */
+ public final static function createWebControllerResolver ($controllerName, ManageableApplication $appInstance) {
+ // Create the new instance
+ $resolverInstance = new WebControllerResolver();
+
+ // Is the variable $controllerName set and the command is valid?
+ if (empty($controllerName)) {
+ // Then thrown an exception here
+ throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ } elseif (!$resolverInstance->isControllerValid($controllerName)) {
+ // Invalid command found
+ throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_COMMAND);
+ }
+
+ // Set the application instance
+ $resolverInstance->setApplicationInstance($appInstance);
+
+ // Set command name
+ $resolverInstance->setControllerName($controllerName);
+
+ // Return the prepared instance
+ return $resolverInstance;
+ }
+
+ /**
+ * Resolves the default controller of the given command
+ *
+ * @return $controllerInstance A controller instance for the default
+ * command
+ * @throws InvalidControllerInstanceException Thrown if $controllerInstance
+ * is invalid
+ */
+ public function resolveController () {
+ // Init variables
+ $controllerName = "";
+ $controllerInstance = null;
+
+ // Get the command name
+ $controllerName = $this->getControllerName();
+
+ // Get the command
+ $controllerInstance = $this->loadController($controllerName);
+
+ // And validate it
+ if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
+ // This command has an invalid instance!
+ throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+ } // END - if
+
+ // Set last controller
+ $this->lastControllerInstance = $controllerInstance;
+
+ // Return the maybe resolved instance
+ return $controllerInstance;
+ }
+
+ /**
+ * "Loads" a given controller and instances it if not yet cached. If the
+ * controller was not found one of the default controllers will be used
+ * depending on wether news shall be displayed.
+ *
+ * @param $controllerName A controller name we shall look for
+ * @return $controllerInstance A loaded controller instance
+ * @throws DefaultControllerException Thrown if even the default
+ * controller class is missing (bad!)
+ */
+ private function loadController ($controllerName) {
+ // Debug message
+ //* DEBUG: */ $this->debugBacktrace();
+
+ // Cache default command
+ $defaultController = $this->getConfigInstance()->readConfig('default_command');
+
+ // Init controller instance
+ $controllerInstance = null;
+
+ // Default controller
+ $className = "WebDefaultController";
+
+ // Generate the class name
+ //* DEBUG: */ echo __METHOD__.": Controller=".$controllerName;
+ if ($controllerName != $defaultController) {
+ // Create controller class name
+ $className = sprintf("Web%sController",
+ $this->convertToClassName($controllerName)
+ );
+ } elseif ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
+ // Yes, display news in home then set default controller with news
+ $className = "WebDefaultNewsController";
+ } else {
+ // No news at "home" page or non-news page
+ $className = "WebDefaultController";
+ }
+ //* DEBUG: */ echo ", controller=".$className."<br />\n";
+
+ // Is this class loaded?
+ if (!class_exists($className)) {
+ // Class not found, so try the default one or throw exception
+ if ($controllerName != $defaultController) {
+ // Try the default controller
+ return $this->loadController($defaultController);
+ } else {
+ // Still not found?
+ throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
+ }
+ } // END - if
+
+ // Initiate the resolver and controller
+ $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($controllerName, $this->getApplicationInstance()));
+ $controllerInstance = ObjectFactory::createObjectByName($className, array($resolverInstance));
+
+ // Remove resolver
+ unset($resolverInstance);
+
+ // Return the result
+ return $controllerInstance;
+ }
+}
+
+// [EOF]
+?>
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A command resolver for local (non-hubbed) commands
- *
- * @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 WebCommandResolver extends BaseResolver implements CommandResolver {
- /**
- * Last successfull resolved command
- */
- private $lastCommandInstance = "";
-
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("Resolver for local web commands");
-
- // Create unique ID number
- $this->generateUniqueId();
-
- // Set prefix to "Web"
- $this->setCommandPrefix("Web");
- }
-
- /**
- * Creates an instance of a Web command resolver with a given default command
- *
- * @param $commandName The default command we shall execute
- * @param $appInstance An instance of a manageable application helper class
- * @return $resolverInstance The prepared command resolver instance
- * @throws EmptyVariableException Thrown if the default command is not set
- * @throws InvalidCommandException Thrown if the default command is invalid
- */
- public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
- // Create the new instance
- $resolverInstance = new WebCommandResolver();
-
- // Is the variable $commandName set and the command is valid?
- if (empty($commandName)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif (!$resolverInstance->isCommandValid($commandName)) {
- // Invalid command found
- throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
- }
-
- // Set the application instance
- $resolverInstance->setApplicationInstance($appInstance);
-
- // Return the prepared instance
- return $resolverInstance;
- }
-
- /**
- * Returns an command instance for a given request class or null if
- * it was not found
- *
- * @param $requestInstance An instance of a request class
- * @return $commandInstance An instance of the resolved command
- * @throws InvalidCommandException Thrown if $commandName is
- * invalid
- * @throws InvalidCommandInstanceException Thrown if $commandInstance
- * is an invalid instance
- */
- public function resolvCommandByRequest (Requestable $requestInstance) {
- // Init variables
- $commandName = "";
- $commandInstance = null;
-
- // This goes fine so let's resolv the command
- $commandName = $requestInstance->getRequestElement("page");
-
- // Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
-
- // Check if the command is valid
- if (!$this->isCommandValid($commandName)) {
- // This command is invalid!
- throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
- } // END - if
-
- // Get the command
- $commandInstance = $this->loadCommand($commandName);
-
- // And validate it
- if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
- // This command has an invalid instance!
- throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
- } // END - if
-
- // Set last command
- $this->lastCommandInstance = $commandInstance;
-
- // Return the resolved command instance
- return $commandInstance;
- }
-
- /**
- * Resolves the command by its direct name and returns an instance of its class
- *
- * @param $commandName The direct command name we shall resolve
- * @return $commandInstance An instance of the command class
- * @throws InvalidCommandException Thrown if $commandName is invalid
- */
- public function resolveCommand ($commandName) {
- // Initiate the instance variable
- $commandInstance = null;
-
- // Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
-
- // Check if the command is valid
- if (!$this->isCommandValid($commandName)) {
- // This command is invalid!
- throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
- }
-
- // Get the command
- $commandInstance = $this->loadCommand($commandName);
-
- // Return the instance
- return $commandInstance;
- }
-
- /**
- * "Loads" a given command and instances it if not yet cached
- *
- * @param $commandName A command name we shall look for
- * @return $commandInstance A loaded command instance
- * @throws InvalidCommandException Thrown if even the default
- * command class is missing (bad!)
- */
- private function loadCommand ($commandName) {
- // Cache default command
- $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
-
- // Init command instance
- $commandInstance = null;
-
- // Create command class name
- $className = sprintf("Web%sCommand",
- $this->convertToClassName($commandName)
- );
-
- // Is this class loaded?
- if (!class_exists($className)) {
- // Class not found, so try the default one or throw exception
- if ($commandName != $defaultCommand) {
- // Try the default command
- return $this->loadCommand($defaultCommand);
- } else {
- // Still not found?
- throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
- }
- } // END - if
-
- // Initiate the command
- $commandInstance = ObjectFactory::createObjectByName($className, array($this));
-
- // Return the result
- return $commandInstance;
- }
-}
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/**
- * A resolver for resolving controllers locally
- *
- * @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 WebControllerResolver extends BaseResolver implements ControllerResolver {
- /**
- * Last successfull resolved controller (name)
- */
- private $lastControllerName = "";
-
- /**
- * Last successfull resolved controller (instance)
- */
- private $lastControllerInstance = null;
-
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("Resolver for local web controllers");
-
- // Create unique ID number
- $this->generateUniqueId();
-
- // Set prefix to "Web"
- $this->setCommandPrefix("Web");
- }
-
- /**
- * Creates an instance of a resolver class with a given command
- *
- * @param $commandName The default command we shall execute
- * @param $appInstance An instance of a manageable application helper class
- * @return $resolverInstance The prepared command resolver instance
- * @throws EmptyVariableException Thrown if the default command is not set
- * @throws InvalidCommandException Thrown if the default command is invalid
- */
- public final static function createWebControllerResolver ($commandName, ManageableApplication $appInstance) {
- // Create the new instance
- $resolverInstance = new WebControllerResolver();
-
- // Is the variable $commandName set and the command is valid?
- if (empty($commandName)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif (!$resolverInstance->isCommandValid($commandName)) {
- // Invalid command found
- throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
- }
-
- // Set the application instance
- $resolverInstance->setApplicationInstance($appInstance);
-
- // Return the prepared instance
- return $resolverInstance;
- }
-
- /**
- * Resolves the default controller of the given command
- *
- * @return $controllerInstance A controller instance for the default
- * command
- * @throws InvalidCommandException Thrown if $commandName is
- * invalid
- * @throws InvalidControllerInstanceException Thrown if $commandInstance
- * is invalid
- */
- public function resolveCommandController () {
- // Init variables
- $commandName = "";
- $controllerInstance = null;
-
- // Get the command name
- $commandName = $this->getCommandName();
-
- // Check if the command is valid
- if (!$this->isCommandValid($commandName)) {
- // This command is invalid!
- throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
- } // END - if
-
- // Get the command
- $controllerInstance = $this->loadController($commandName);
-
- // And validate it
- if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
- // This command has an invalid instance!
- throw new InvalidControllerInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_CONTROLLER);
- } // END - if
-
- // Set last controller
- $this->lastControllerInstance = $controllerInstance;
-
- // Return the maybe resolved instance
- return $controllerInstance;
- }
-
- /**
- * "Loads" a given controller and instances it if not yet cached. If the
- * controller was not found one of the default controllers will be used
- * depending on wether news shall be displayed.
- *
- * @param $commandName A controller name we shall look for
- * @return $controllerInstance A loaded controller instance
- * @throws DefaultControllerException Thrown if even the default
- * controller class is missing (bad!)
- */
- private function loadController ($commandName) {
- // Debug message
- //* DEBUG: */ $this->debugBacktrace();
-
- // Cache default command
- $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
-
- // Init controller instance
- $controllerInstance = null;
-
- // Default controller
- $class = "WebDefaultController";
-
- // Generate the class name
- //* DEBUG: */ echo __METHOD__.": Command=".$commandName;
- if ($commandName != $defaultCommand) {
- // Create controller class name
- $class = sprintf("Web%sController",
- $this->convertToClassName($commandName)
- );
- } elseif ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
- // Yes, display news in home then set default controller with news
- $class = "WebDefaultNewsController";
- } else {
- // No news at "home" page or non-news page
- $class = "WebDefaultController";
- }
- //* DEBUG: */ echo ", controller=".$class."<br />\n";
-
- // Is this class loaded?
- if (!class_exists($class)) {
- // Class not found, so try the default one or throw exception
- if ($commandName != $defaultCommand) {
- // Try the default controller
- return $this->loadController($defaultCommand);
- } else {
- // Still not found?
- throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
- }
- } // END - if
-
- // Initiate the resolver and controller
- $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($commandName, $this->getApplicationInstance()));
- $controllerInstance = ObjectFactory::createObjectByName($class, array($resolverInstance));
-
- // Remove resolver
- unset($resolverInstance);
-
- // Return the result
- return $controllerInstance;
- }
-}
-
-// [EOF]
-?>
// CFG: PASSWORD-VALIDATOR
$cfg->setConfigEntry('password_validator_class', "PasswordValidatorFilter");
-// CFG: RULES-ACCEPTED-FILTER
+// CFG: RULES-ACCEPTED-CLASS
$cfg->setConfigEntry('rules_accepted_class', "RulesAcceptedFilter");
// CFG: USERNAME-VERIFIER
// CFG: EMAIL-CHANGE-CLASS
$cfg->setConfigEntry('email_change_class', "EmailChangeFilter");
-// CFG: PASSWORD-CHANGE-FILTER
+// CFG: PASSWORD-CHANGE-CLASS
$cfg->setConfigEntry('password_change_class', "PasswordChangeFilter");
+// CFG: ACCOUNT-PASSWORD-CLASS
+$cfg->setConfigEntry('account_password_class', "AccountPasswordVerifierFilter");
+
+// CFG: USER-STATUS-CLASS
+$cfg->setConfigEntry('user_status_class', "UserStatusVerifierFilter");
+
// CFG: CRYPTO-HELPER
$cfg->setConfigEntry('crypto_class', "CryptoHelper");