application/blog/loader.php -text
application/blog/main/.htaccess -text
application/blog/main/actions/.htaccess -text
+application/blog/main/actions/class_ -text
+application/blog/main/actions/class_BaseBlogAction.php -text
application/blog/main/actions/web/.htaccess -text
application/blog/main/actions/web/class_WebBlogLoginWelcomeAction.php -text
application/blog/main/class_ -text
application/blog/main/commands/web/.htaccess -text
application/blog/main/commands/web/class_WebBlogGuestLoginCommand.php -text
application/blog/main/commands/web/class_WebBlogUserLoginCommand.php -text
+application/blog/main/commands/web/failed/.htaccess -text
+application/blog/main/commands/web/failed/class_WebBlogFailedCommand.php -text
+application/blog/main/controller/.htaccess -text
+application/blog/main/controller/web/.htaccess -text
+application/blog/main/controller/web/class_WebBlogFailedController.php -text
+application/blog/main/filter/.htaccess -text
+application/blog/main/filter/blog/.htaccess -text
+application/blog/main/filter/blog/class_BlogDataFetchFilter.php -text
+application/blog/main/filter/class_ -text
+application/blog/main/filter/class_BaseBlogFilter.php -text
application/blog/main/login/.htaccess -text
application/blog/main/login/class_BlogGuestLogin.php -text
application/blog/main/login/class_BlogUserLogin.php -text
application/ship-simu/loader.php -text
application/ship-simu/main/.htaccess -text
application/ship-simu/main/actions/.htaccess -text
+application/ship-simu/main/actions/class_ -text
+application/ship-simu/main/actions/class_BaseShipSimuAction.php -text
application/ship-simu/main/actions/ship-simu/.htaccess -text
application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php -text
application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -text
application/ship-simu/main/factories/.htaccess -text
application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text
application/ship-simu/main/filter/.htaccess -text
+application/ship-simu/main/filter/class_ -text
+application/ship-simu/main/filter/class_BaseShipSimuFilter.php -text
application/ship-simu/main/filter/goverment/.htaccess -text
application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysStartupHelpFilter.php -text
application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php -text
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Exit here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
// Which login type do we have?
switch ($this->getConfigInstance()->readConfig('login_type')) {
case "username": // Login via username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
break;
case "email": // Login via email
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter', array($controllerInstance)));
break;
default: // Wether username or email is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter', array($controllerInstance)));
break;
}
// Password verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter', array($controllerInstance)));
// Add filter for CAPTCHA
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter', array($controllerInstance)));
}
}
// CFG: USER-NOT-FOUND-URL
$cfg->setConfigEntry('user_not_found_url', "index.php?app={?app_short_name?}&page=status&status=user_not_found");
+// CFG: LOGIN-BLOG-FAILED-USER-URL
+$cfg->setConfigEntry('login_blog_failed_user_url', "index.php?app={?app_short_name?}&page=blog_failed&failed=user");
+
// CFG: LOGIN-DEFAULT-ACTION
$cfg->setConfigEntry('login_default_action', "welcome");
// CFG: NEWS-READER-LOGIN-AREA-CLASS
$cfg->setConfigEntry('news_reader_login_area_class', "DefaultNewsReader");
+// CFG: NEWS-READER-BLOG-FAILED-CLASS
+$cfg->setConfigEntry('news_reader_blog_failed_class', "DefaultNewsReader");
+
// CFG: NEWS-DOWNLOAD-FILTER
$cfg->setConfigEntry('news_download_filter', "NewsDownloadFilter");
// CFG: USER-UPDATE-FILTER
$cfg->setConfigEntry('user_update_filter', "UserUpdateFilter");
+// CFG: BLOG-DATA-FILTER
+$cfg->setConfigEntry('blog_data_filter', "BlogDataFetchFilter");
+
// CFG: USER-STATUS-CONFIRMED-FILTER
$cfg->setConfigEntry('user_status_confirmed_filter', "UserStatusConfimedUpdateFilter");
// CFG: NEWS-LOGIN-AREA-LIMIT
$cfg->setConfigEntry('news_login_area_limit', 15);
+// CFG: NEWS-BLOG-FAILED-LIMIT
+$cfg->setConfigEntry('news_blog_failed_limit', 15);
+
// CFG: LOGIN-ENABLED
$cfg->setConfigEntry('login_enabled', "Y");
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @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 ???Action extends BaseBlogAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @param $resolverInstance An instance of an action resolver
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function create???Action (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new ???Action();
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here
+ $this->partialStub("You have to implement me.");
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Call parent addExtraFilters method
+ parent::addExtraFilters($controllerInstance, $requestInstance);
+
+ // Unfinished method
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general action class for blog
+ *
+ * @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 BaseBlogAction extends BaseAction {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Add code here executed with every action
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Fetch some blog data
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('blog_data_filter', array($controllerInstance)));
+ }
+}
+
+// [EOF]
+?>
* 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 WebBlogLoginWelcomeAction extends BaseAction implements Commandable, Registerable {
+class WebBlogLoginWelcomeAction extends BaseBlogAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Execute some code here
}
/**
* @todo Add some filters here
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Call parent addExtraFilters method
+ parent::addExtraFilters($controllerInstance, $requestInstance);
+
// Unfinished method
}
}
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Exit here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Add username verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter', array($controllerInstance)));
// Add password verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter', array($controllerInstance)));
// Add CAPTCHA verifier code
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter', array($controllerInstance)));
}
}
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Exit here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
// Which login type do we have?
switch ($this->getConfigInstance()->readConfig('login_type')) {
case "username": // Login via username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
break;
case "email": // Login via email
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter', array($controllerInstance)));
break;
default: // Wether username or email is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter', array($controllerInstance)));
break;
}
// Password verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter', array($controllerInstance)));
// Add filter for CAPTCHA
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter', array($controllerInstance)));
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A command for failed blog "requests"
+ *
+ * @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 WebBlogFailedCommand extends BaseCommand implements Commandable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $resolverInstance An instance of a command resolver class
+ * @return $commandInstance An instance a prepared command class
+ */
+ public final static function createWebBlogFailedCommand (CommandResolver $resolverInstance) {
+ // Get new instance
+ $commandInstance = new WebBlogFailedCommand();
+
+ // Set the application instance
+ $commandInstance->setResolverInstance($resolverInstance);
+
+ // Return the prepared instance
+ return $commandInstance;
+ }
+
+ /**
+ * Executes the given command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ $this->partialStub("Unfinished method.");
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Empty for now
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * Controller for failed blog data "requests"
+ *
+ * @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 WebBlogFailedController extends BaseController implements Controller {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $resolverInstance An instance of a command resolver class
+ * @return $controllerInstance A prepared instance of this class
+ * @todo Add some filters to this controller
+ */
+ public final static function createWebBlogFailedController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new WebBlogFailedController();
+
+ // Set the command resolver
+ $controllerInstance->setResolverInstance($resolverInstance);
+
+ // User auth filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
+
+ // User update filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance)));
+
+ // News fetcher filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
+
+ // News proccess/display-preparation
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
+
+ // Return the prepared instance
+ return $controllerInstance;
+ }
+
+ /**
+ * Handles the given request and response
+ *
+ * @param $requestInstance An instance of a request class
+ * @param $responseInstance An instance of a response class
+ * @return void
+ */
+ 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()->resolveCommandByRequest($requestInstance);
+
+ // Add more filters by the command
+ $commandInstance->addExtraFilters($this, $requestInstance);
+
+ // Try to run the pre filters, if auth exceptions come through redirect here
+ try {
+ // Run the pre filters
+ $this->executePreFilters($requestInstance, $responseInstance);
+ } catch (UserAuthorizationException $e) {
+ // Redirect to main page
+ $responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+ // Exit here
+ exit();
+ }
+
+ // This request was valid! :-D
+ $requestInstance->requestIsValid();
+
+ // Execute the command
+ $commandInstance->execute($requestInstance, $responseInstance);
+
+ // Run the pre filters
+ $this->executePostFilters($requestInstance, $responseInstance);
+
+ // Flush the response out
+ $responseInstance->flushBuffer();
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A filter for fetching blog data related to the current user
+ *
+ * @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 BlogDataFetchFilter extends BaseBlogFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createBlogDataFetchFilter (Controller $controllerInstance) {
+ // Get a new instance
+ $filterInstance = new BlogDataFetchFilter();
+
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
+ // 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
+ * @todo Add code being executed in this filter
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Get a user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Is the user instance valid?
+ if (!$userInstance instanceof ManageableMember) {
+ // Request is invalid
+ $requestInstance->requestIsValid(false);
+
+ // Redirect to configured URL
+ $responseInstance->redirectToConfiguredUrl('login_blog_failed_user_url');
+
+ // Stop processing here
+ exit();
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A filter for money refill page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Filter extends BaseBlogFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function create???Filter (Controller $controllerInstance) {
+ // Get a new instance
+ $filterInstance = new ???Filter();
+
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
+ // 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
+ * @todo Add code being executed in this filter
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ $this->partialStub("Add code here for your specific filter.");
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general filter class for Ship-Simu
+ *
+ * @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 BaseBlogFilter extends BaseFilter {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the filter class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * 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
+ * @todo 0%
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Add something to do on every filter
+ }
+}
+
+// [EOF]
+?>
// Flush the content out to a template variable
$blockInstance->flushContent();
+// Get a new instance for blog data
+$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'blog_data'));
+
+// Set the data source instance which must exist in registry
+$blockInstance->prefetchValueInstance('blog');
+
+// Flush the content out to a template variable
+$blockInstance->flushContent();
+
// Get helper instance
$helper = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout_action_link', 'index.php?app={?app_short_name?}&page=login_area'));
{?persona_data?}
</div>
+ <div id="persona_body">
+ {?blog_data?}
+ </div>
+
<div id="logout_link">
{?logout_action_link?}
</div>
/**
* The application selector class.
*
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
* @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @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 ???Action extends BaseShipSimuAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @param $resolverInstance An instance of an action resolver
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function create???Action (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new ???Action();
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here
+ $this->partialStub("You have to implement me.");
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Call parent addExtraFilters method
+ parent::addExtraFilters($controllerInstance, $requestInstance);
+
+ // Unfinished method
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general action class for blog
+ *
+ * @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 BaseShipSimuAction extends BaseAction {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Add code here executed with every action
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Unfinished method
+ }
+}
+
+// [EOF]
+?>
* 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 ShipSimuLoginAction extends BaseAction implements PerformableAction {
+class ShipSimuLoginAction extends BaseShipSimuAction implements PerformableAction {
/**
* Protected constructor
*
* @todo Maybe we need to do something later here
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here
}
}
* 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 ShipSimuProfileAction extends BaseAction implements PerformableAction {
+class ShipSimuProfileAction extends BaseShipSimuAction implements PerformableAction {
/**
* Protected constructor
*
* @todo Maybe we need to do something later here */
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Empty for now
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
}
* 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 WebShipSimuLoginCompanyAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginCompanyAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo Maybe add fetching company list of current user here?
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
}
}
* 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 WebShipSimuLoginGovermentStartupHelpAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginGovermentStartupHelpAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Check if goverment can pay startup help
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter', array($controllerInstance)));
}
}
* 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 WebShipSimuLoginGovermentTrainingAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginGovermentTrainingAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Check if goverment can pay a training
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_training_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_training_filter', array($controllerInstance)));
}
}
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class WebShipSimuLoginLogoutAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginLogoutAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
}
}
* 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 WebShipSimuLoginProfileAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginProfileAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
}
}
* 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 WebShipSimuLoginRefillAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginRefillAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Check for user status by default
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Is the refill page active?
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter', array($controllerInstance)));
// Add payment discovery filter
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this)));
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class WebShipSimuLoginWelcomeAction extends BaseAction implements Commandable, Registerable {
+class WebShipSimuLoginWelcomeAction extends BaseShipSimuAction implements Commandable, Registerable {
/**
* Protected constructor
*
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Unfinished method
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
}
/**
*/
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_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Is the refill page active?
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter', array($controllerInstance)));
// Verify password
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance)));
// Verify CAPTCHA code
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter', array($controllerInstance)));
// Verify refill request
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter', array($controllerInstance)));
// Prepare a filter based on the requested type we shall refill
$filterName = sprintf("refill_request_%s_book_filter", $requestInstance->getRequestElement('type'));
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Exit here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Add username verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter', array($controllerInstance)));
// Add password verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter', array($controllerInstance)));
// Add CAPTCHA verifier code
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter', array($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_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// User status filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Updated rules accepted
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter', array($controllerInstance)));
// Account password validation
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance)));
// Validate CAPTCHA input
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter', array($controllerInstance)));
// Validate birthday input
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter', array($controllerInstance)));
// Email changed
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter', array($controllerInstance)));
// Password changed
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter', array($controllerInstance)));
}
}
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Validate email address (if configured: check on double email addresses)
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter', array($controllerInstance)));
// Validate username and check if it does not exist
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter', array($controllerInstance)));
// Validate if username is "guest" and not taken
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter', array($controllerInstance)));
// Validate if password is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter', array($controllerInstance)));
// Check if rules where accepted
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter', array($controllerInstance)));
// Validate CAPTCHA input
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter', array($controllerInstance)));
// Validate birthday
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter', array($controllerInstance)));
}
}
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Exit here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
// Which login type do we have?
switch ($this->getConfigInstance()->readConfig('login_type')) {
case "username": // Login via username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
break;
case "email": // Login via email
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter', array($controllerInstance)));
break;
default: // Wether username or email is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter', array($controllerInstance)));
break;
}
// Password verifier filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter', array($controllerInstance)));
// Add filter for CAPTCHA
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter', array($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_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Check if goverment can pay startup help
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter', array($controllerInstance)));
// Verify password
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance)));
// Verify CAPTCHA code
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter', array($controllerInstance)));
}
}
$controllerInstance->setResolverInstance($resolverInstance);
// User auth filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// User update filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance)));
// News fetcher filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
// News proccess/display-preparation
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
} catch (UserAuthorizationException $e) {
// Redirect to main page
$responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+ // Exit here
+ exit();
}
// This request was valid! :-D
--- /dev/null
+<?php
+/**
+ * A filter for money refill page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Filter extends BaseShipSimuFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function create???Filter (Controller $controllerInstance) {
+ // Get a new instance
+ $filterInstance = new ???Filter();
+
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
+ // 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
+ * @todo Add code being executed in this filter
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ $this->partialStub("Add code here for your specific filter.");
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general filter class for Ship-Simu
+ *
+ * @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 BaseShipSimuFilter extends BaseFilter {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the filter class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * 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
+ * @todo 0%
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Add something to do on every filter
+ }
+}
+
+// [EOF]
+?>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class ShipSimuGovermentPaysStartupHelpFilter extends BaseFilter implements Filterable {
+3class ShipSimuGovermentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable {
/**
* Protected constructor
*
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createShipSimuGovermentPaysStartupHelpFilter () {
+ public final static function createShipSimuGovermentPaysStartupHelpFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new ShipSimuGovermentPaysStartupHelpFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
// Get the user instance from registry
$userInstance = Registry::getRegistry()->getInstance('user');
* 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 ShipSimuGovermentPaysTrainingFilter extends BaseFilter implements Filterable {
+class ShipSimuGovermentPaysTrainingFilter extends BaseShipSimuFilter implements Filterable {
/**
* Protected constructor
*
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createShipSimuGovermentPaysTrainingFilter () {
+ public final static function createShipSimuGovermentPaysTrainingFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new ShipSimuGovermentPaysTrainingFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
// Get the user instance from registry
$userInstance = Registry::getRegistry()->getInstance('user');
* 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 RefillPageFilter extends BaseFilter implements Filterable {
+class RefillPageFilter extends BaseShipSimuFilter implements Filterable {
/**
* Protected constructor
*
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createRefillPageFilter () {
+ public final static function createRefillPageFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new RefillPageFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
// Is the configuration variable set?
if ($this->getConfigInstance()->readConfig('refill_page_active') === "N") {
// Password is empty
* 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 RefillRequestValidatorFilter extends BaseFilter implements Filterable {
+class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filterable {
/**
* Protected constructor
*
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createRefillRequestValidatorFilter () {
+ public final static function createRefillRequestValidatorFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new RefillRequestValidatorFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
// Are all required request fields set?
if (($requestInstance->isRequestElementSet('type') === false) || ($requestInstance->isRequestElementSet('amount') === false)) {
// Something important is missing
* 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 BirthdayVerifierFilter extends BaseFilter implements Filterable {
+class BirthdayVerifierFilter extends BaseShipSimuFilter implements Filterable {
/**
* Protected constructor
*
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createBirthdayVerifierFilter () {
+ public final static function createBirthdayVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new BirthdayVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
// Implement this!
$this->partialStub("Please implement this method.");
}
// Flush the content out to a template variable
$blockInstance->flushContent();
-//////////////////////////////////////
-// Assign the shipping company data //
-//////////////////////////////////////
-
-// Get a new instance for personal data
-$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data'));
-
-// Set the data source instance
-$blockInstance->prefetchValueInstance('company', 'user');
-
-// Assign the company name
-if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
- // User is the founder of the company
- $blockInstance->assignMessageField('company_status', "user_is_company_founder");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
- // User owns the company
- $blockInstance->assignMessageField('company_status', "user_is_company_owner");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
- // User is employed in company
- $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
-} else {
- // No company participation!
- $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company");
- $blockInstance->assignMessageField('company_link_text', "link_text_company");
- $blockInstance->assignMessageField('company_link_title', "link_title_company");
-}
-
-// Flush the content out to a template variable
-$blockInstance->flushContent();
-
// Get helper instance
$helper = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout_action_link', 'index.php?app={?app_short_name?}&page=login_area'));
// Flush the content out to a template variable
$blockInstance->flushContent();
-//////////////////////////////////////
-// Assign the shipping company data //
-//////////////////////////////////////
-
-// Get a new instance for personal data
-$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data'));
-
-// Set the data source instance
-$blockInstance->prefetchValueInstance('company', 'user');
-
-// Assign the company name
-if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
- // User is the founder of the company
- $blockInstance->assignMessageField('company_status', "user_is_company_founder");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
- // User owns the company
- $blockInstance->assignMessageField('company_status', "user_is_company_owner");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
-} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
- // User is employed in company
- $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
- $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
- $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
-} else {
- // No company participation!
- $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
- $blockInstance->assignLinkFieldWithAction('company_link' , "company");
- $blockInstance->assignMessageField('company_link_text', "link_text_company");
- $blockInstance->assignMessageField('company_link_title', "link_title_company");
-}
-
-// Flush the content out to a template variable
-$blockInstance->flushContent();
-
// Get helper instance
$helper = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout_action_link', 'index.php?app={?app_short_name?}&page=login_area'));
);
// End here
- exit;
+ exit();
} // END - if
// Make sure everything is assigned properly
parent::__construct($message, $code);
if ($loginInstance->ifLoginWasSuccessfull()) {
// Try to redirect here
try {
+ // Redirect...
$responseInstance->redirectToConfiguredUrl('app_login_url');
+
+ // Stop here
+ exit();
} catch (FrameworkException $e) {
// Something went wrong here!
$responseInstance->addFatalMessage($e->getMessage());
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Add user status filter here
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
}
}
*/
private $userInstance = null;
+ /**
+ * A controller instance
+ */
+ private $controllerInstance = null;
+
/**
* The real class name
*/
print("<pre>\n");
debug_print_backtrace();
print("</pre>");
- exit;
+ exit();
}
/**
public final function getUserInstance () {
return $this->userInstance;
}
+
+ /**
+ * 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;
+ }
}
// [EOF]
// Redirect to "logout done" page
$responseInstance->redirectToConfiguredUrl('logout_done_url');
+
+ // Exit here
+ exit();
}
/**
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Filter for checking if account is unconfirmed
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
}
}
$controllerInstance->setResolverInstance($resolverInstance);
// Add filter for checking the "encrypt" string
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
} catch (UserAuthorizationException $e) {
// Redirect to main page
$responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+ // Exit here
+ exit();
}
// Is the request still valid? Post filters shall only be executed of
$controllerInstance->setResolverInstance($resolverInstance);
// User auth filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// User update filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance)));
// News fetcher filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
// News proccess/display-preparation
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
} catch (UserAuthorizationException $e) {
// Redirect to main page
$responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+ // Exit here
+ exit();
}
// This request was valid! :-D
$controllerInstance->setResolverInstance($resolverInstance);
// Add filters for handling confirmation code and username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter', array($controllerInstance)));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
$controllerInstance->setResolverInstance($resolverInstance);
// Add news filters to this controller
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
$controllerInstance->setResolverInstance($resolverInstance);
// Add user auth filter (we don't need an update of the user here because it will be redirected)
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
// User status filter
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
// Return the prepared instance
return $controllerInstance;
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserAuthFilter () {
+ public final static function createUserAuthFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserAuthFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Set default auth method
$filterInstance->setDefaultAuthMethod();
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createEmailChangeFilter () {
+ public final static function createEmailChangeFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new EmailChangeFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createPasswordChangeFilter () {
+ public final static function createPasswordChangeFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new PasswordChangeFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createRulesAcceptedFilter () {
+ public final static function createRulesAcceptedFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new RulesAcceptedFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function create???Filter () {
+ public final static function create???Filter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new ???Filter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createCaptchaEncryptFilter () {
+ public final static function createCaptchaEncryptFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new CaptchaEncryptFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserNameIsGuestFilter () {
+ public final static function createUserNameIsGuestFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserNameIsGuestFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createNewsDownloadFilter () {
+ public final static function createNewsDownloadFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new NewsDownloadFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createNewsProcessFilter () {
+ public final static function createNewsProcessFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new NewsProcessFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createNullFilter () {
+ public final static function createNullFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new NullFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserStatusConfimedUpdateFilter () {
+ public final static function createUserStatusConfimedUpdateFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserStatusConfimedUpdateFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserUpdateFilter () {
+ public final static function createUserUpdateFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserUpdateFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createEmailValidatorFilter () {
+ public final static function createEmailValidatorFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new EmailValidatorFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createPasswordValidatorFilter () {
+ public final static function createPasswordValidatorFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new PasswordValidatorFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserNameValidatorFilter () {
+ public final static function createUserNameValidatorFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserNameValidatorFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createAccountPasswordVerifierFilter () {
+ public final static function createAccountPasswordVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new AccountPasswordVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createConfirmCodeVerifierFilter () {
+ public final static function createConfirmCodeVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new ConfirmCodeVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
$responseInstance->redirectToConfiguredUrl('confirm_code_invalid_url');
// Stop processing here
- exit;
+ exit();
} // END - if
}
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createGraphicalCodeCaptchaVerifierFilter () {
+ public final static function createGraphicalCodeCaptchaVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new GraphicalCodeCaptchaVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createPasswordGuestVerifierFilter () {
+ public final static function createPasswordGuestVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new PasswordGuestVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createPasswordVerifierFilter () {
+ public final static function createPasswordVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new PasswordVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserGuestVerifierFilter () {
+ public final static function createUserGuestVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserGuestVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserNameVerifierFilter () {
+ public final static function createUserNameVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserNameVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserStatusVerifierFilter () {
+ public final static function createUserStatusVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserStatusVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createUserUnconfirmedVerifierFilter () {
+ public final static function createUserUnconfirmedVerifierFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new UserUnconfirmedVerifierFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
*/
private $commandName = "";
- /**
- * A controller instance
- */
- private $controllerInstance = null;
-
/**
* Protected constructor
*
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
*