- First 'welcome' or 'overview' page is "ready".
- Registration is half-finished (confirmation is not done)
- Added a lot more classes
Signed-off-by: Roland Haeder <roland@mxchange.org>
// CFG: CITY-HTML-CMD-REGISTER-RESOLVER-CLASS
$cfg->setConfigEntry('city_html_cmd_register_resolver_class', 'CityHtmlCommandResolver');
+// CFG: CITY-HTML-CMD-LOGIN-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_login_resolver_class', 'HtmlCommandResolver');
+
// CFG: NEWS-READER-HOME-CLASS
$cfg->setConfigEntry('news_reader_home_class', 'DefaultNewsReader');
// CFG: NEWS-READER-REGISTER-CLASS
$cfg->setConfigEntry('news_reader_register_class', 'DefaultNewsReader');
+// CFG: NEWS-READER-LOGIN-AREA-CLASS
+$cfg->setConfigEntry('news_reader_login_area_class', 'DefaultNewsReader');
+
// CFG: NEWS-HOME-LIMIT
$cfg->setConfigEntry('news_home_limit', 10);
// CFG: NEWS-REGISTER-LIMIT
$cfg->setConfigEntry('news_register_limit', 5);
+// CFG: NEWS-LOGIN-AREA-LIMIT
+$cfg->setConfigEntry('news_login_area_limit', 5);
+
// CFG: CITY-HOME-MENU-CLASS
$cfg->setConfigEntry('city_home_menu_class', 'CityHomeMenu');
// CFG: CITY-REGISTER-MENU-CLASS
$cfg->setConfigEntry('city_register_menu_class', 'CityRegisterMenu');
+// CFG: LOGIN-FAILED-MENU-CLASS
+$cfg->setConfigEntry('login_failed_menu_class', 'CityLoginFailedMenu');
+
+// CFG: STATUS-MENU-CLASS
+$cfg->setConfigEntry('status_menu_class', 'CityStatusMenu');
+
+// CFG: LOGIN-MENU-CLASS
+$cfg->setConfigEntry('login_menu_class', 'CityLoginMenu');
+
+// CFG: LOGOUT-MENU-CLASS
+$cfg->setConfigEntry('logout_menu_class', 'CityLogoutMenu');
+
+// CFG: REGISTER-MENU-CLASS
+$cfg->setConfigEntry('register_menu_class', 'CityRegisterMenu');
+
+// CFG: CONFIRM-MENU-CLASS
+$cfg->setConfigEntry('confirm_menu_class', 'CityConfirmMenu');
+
+// CFG: LOGIN-AREA-MENU-CLASS
+$cfg->setConfigEntry('login_area_menu_class', 'CityLoginAreaMenu');
+
+// CFG: GOVERNMENT-FAILED-AREA-MENU-CLASS
+$cfg->setConfigEntry('government_failed_area_menu_class', 'CityGovernmentFailedAreaMenu');
+
// CFG: MENU-TEMPLATE-CLASS
$cfg->setConfigEntry('menu_template_class', 'MenuTemplateEngine');
// CFG: MENU-TEMPLATE-EXTENSION
$cfg->setConfigEntry('menu_template_extension', '.xml');
+// CFG: HTML-BLOCK-HELPER
+$cfg->setConfigEntry('html_block_helper_class', 'HtmlBlockHelper');
+
// CFG: HTML-FORM-HELPER
-$cfg->setConfigEntry('html_form_helper', 'HtmlFormHelper');
+$cfg->setConfigEntry('html_form_helper_class', 'HtmlFormHelper');
+
+// CFG: HTML-LINK-HELPER
+$cfg->setConfigEntry('html_link_helper_class', 'HtmlLinkHelper');
// CFG: FORM-ACTION
$cfg->setConfigEntry('form_action', 'index.php?app={?app_short_name?}&command=do_form');
// CFG: CITY-HTML-CMD-DO-FORM-RESOLVER-CLASS
$cfg->setConfigEntry('city_html_cmd_do_form_resolver_class', 'HtmlCommandResolver');
+// CFG: CITY-HTML-CMD-LOGIN-AREA-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_login_area_resolver_class', 'HtmlCommandResolver');
+
+// CFG: CITY-HTML-CMD-CONFIRM-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_confirm_resolver_class', 'HtmlCommandResolver');
+
+// CFG: CITY-HTML-CMD-PROBLEM-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_problem_resolver_class', 'HtmlCommandResolver');
+
+// CFG: CITY-HTML-CMD-LOGOUT-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_logout_resolver_class', 'HtmlCommandResolver');
+
// CFG: CAPTCHA-GUEST-VERIFIER-FILTER
$cfg->setConfigEntry('captcha_guest_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter');
// CFG: BIRTHDAY-PROFILE-VERIFIER-FILTER
$cfg->setConfigEntry('birthday_profile_verifier_filter', 'BirthdayVerifierFilter');
+// CFG: GUEST-LOGIN-USERNAME
+$cfg->setConfigEntry('guest_login_user', 'guest');
+
+// CFG: GUEST-LOGIN-PASS
+$cfg->setConfigEntry('guest_login_passwd', 'guest');
+
+// CFG: USER-REGISTRATION
+$cfg->setConfigEntry('user_registration_class', 'CityRegistration');
+
+// CFG: USER-LOGIN-CLASS
+$cfg->setConfigEntry('user_login_class', 'CityUserLogin');
+
+// CFG: GUEST-LOGIN-CLASS
+$cfg->setConfigEntry('guest_login_class', 'CityGuestLogin');
+
+// CFG: CONFIRM-EMAIL-ENABLED
+$cfg->setConfigEntry('confirm_email_enabled', 'Y');
+
+// CFG: USER-STATUS-REGISTER
+$cfg->setConfigEntry('user_status_unconfirmed', 'UNCONFIRMED');
+
+// CFG: USER-STATUS-GUEST
+$cfg->setConfigEntry('user_status_guest', 'GUEST');
+
+// CFG: USER-STATUS-CONFIRMED
+$cfg->setConfigEntry('user_status_confirmed', 'CONFIRMED');
+
+// CFG: USER-STATUS-LOCKED
+$cfg->setConfigEntry('user_status_locked', 'LOCKED');
+
+// CFG: LOGIN-HELPER-CLASS
+$cfg->setConfigEntry('login_helper_class', 'CityLoginHelper');
+
+// CFG: AUTH-METHOD-CLASS
+$cfg->setConfigEntry('auth_method_class', 'CookieAuth');
+
+// CFG: APP-LOGIN-URL
+$cfg->setConfigEntry('app_login_url', 'index.php?app={?app_short_name?}&command=login_area');
+
+// CFG: LOGIN-FAILED-URL
+$cfg->setConfigEntry('login_failed_url', 'index.php?app={?app_short_name?}&command=login_failed');
+
+// CFG: LOGIN-FAILED-LOGIN-RETRY-ACTION-URL
+$cfg->setConfigEntry('login_failed_login_retry_action_url', 'index.php?app={?app_short_name?}&command=login&note=login_failed');
+
+// CFG: LOGIN-AREA-LOGOUT-ACTION-URL
+$cfg->setConfigEntry('login_area_logout_action_url', 'index.php?app={?app_short_name?}&command=login_area');
+
+// CFG: GOVERNMENT-FAILED-LOGOUT-ACTION-URL
+$cfg->setConfigEntry('government_failed_logout_action_url', 'index.php?app={?app_short_name?}&command=login_area');
+
+// CFG: LOGIN-AREA-PROFILE-ACTION-URL
+$cfg->setConfigEntry('login_area_profile_action_url', 'index.php?app={?app_short_name?}&command=login_area&status=profile');
+
+// CFG: GOVERNMENT-FAILED-PROFILE-ACTION-URL
+$cfg->setConfigEntry('government_failed_profile_action_url', 'index.php?app={?app_short_name?}&command=login_area&status=profile');
+
+// CFG: LOGIN-AREA-LOGOUT-NOW-ACTION-URL
+$cfg->setConfigEntry('login_area_logout_now_action_url', 'index.php?app={?app_short_name?}&command=logout');
+
+// CFG: LOGIN-AREA-RETURN-LOGIN-ACTION-URL
+$cfg->setConfigEntry('login_area_return_login_action_url', 'index.php?app={?app_short_name?}&command=login_area');
+
+// CFG: LOGIN-AREA-SHIPSIMU-PROFILE-ACTION-URL
+$cfg->setConfigEntry('login_area_shipsimu_profile_action_url', 'index.php?app={?app_short_name?}&command=login_area&action=profile');
+
+// CFG: LOGOUT_DONE-RELOGIN-ACTION-URL
+$cfg->setConfigEntry('logout_done_relogin_action_url', 'index.php?app={?app_short_name?}&command=login');
+
+// CFG: LOGIN-REGISTER-ACTION-URL
+$cfg->setConfigEntry('login_register_action_url', 'index.php?app={?app_short_name?}&command=register');
+
+// CFG: CONFIRM-DIRECT-LOGIN-ACTION-URL
+$cfg->setConfigEntry('confirm_direct_login_action_url', 'index.php?app={?app_short_name?}&command=login_area');
+
+// CFG: LOGOUT-DONE-URL
+$cfg->setConfigEntry('logout_done_url', 'index.php?app={?app_short_name?}&command=logout_done');
+
+// CFG: ACTION-STATUS-PROBLEM
+$cfg->setConfigEntry('action_status_problem', 'status_problem');
+
+// CFG: LOGIN-USER-STATUS-URL
+$cfg->setConfigEntry('login_user_status_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=status_problem&status=general');
+
+// CFG: LOGIN-USER-STATUS-GUEST-URL
+$cfg->setConfigEntry('login_user_status_guest_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=status_problem&status=guest');
+
+// CFG: USER-NOT-UNCONFIRMED-URL
+$cfg->setConfigEntry('user_not_unconfirmed_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=unconfirmed_problem');
+
+// CFG: USER-UNCONFIRMED-EMAIL-MISSING-URL
+$cfg->setConfigEntry('user_unconfirmed_email_missing_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=unconfirmed_email_missing');
+
+// CFG: CONFIRM-CODE-INVALID-URL
+$cfg->setConfigEntry('confirm_code_invalid_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=confirm_code_invalid');
+
+// CFG: USER-NOT-FOUND-URL
+$cfg->setConfigEntry('user_not_found_url', 'index.php?app={?app_short_name?}&command=login_area&action=status_problem&status=user_not_found');
+
+// CFG: USER-AUTH-FILTER
+$cfg->setConfigEntry('user_auth_filter', 'UserAuthFilter');
+
+// CFG: USER-UPDATE-FILTER
+$cfg->setConfigEntry('user_update_filter', 'UserUpdateFilter');
+
+// CFG: LOGIN-DEFAULT-ACTION
+$cfg->setConfigEntry('login_default_action', 'welcome');
+
+// CFG: MONEYBANK-ACTIVATED
+$cfg->setConfigEntry('moneybank_activated', 'Y');
+
+// CFG: MONEYBANK-OPENING-CLASS
+$cfg->setConfigEntry('moneybank_opening_class', 'MoneyBankRealtimeOpening');
+
+// CFG: USER-POINTS-CLASS
+$cfg->setConfigEntry('user_points_class', 'UserPoints');
+
+// CFG: BLOCK-SHOWS-REGISTRATION
+$cfg->setConfigEntry('block_shows_registration', 'Y');
+
+// CFG: GOVERNMENT-CLASS
+$cfg->setConfigEntry('government_class', 'SimplifiedGovernment');
+
+// CFG: BANK-CLASS
+$cfg->setConfigEntry('bank_class', 'MoneyBank');
+
+// CFG: USER-POINTS-DB-WRAPPER-CLASS
+$cfg->setConfigEntry('user_points_db_wrapper_class', 'UserPointsDatabaseWrapper');
+
+// CFG: USER-GOVERNMENT-WRAPPER-CLASS
+$cfg->setConfigEntry('user_government_wrapper_class', 'UserGovernmentDatabaseWrapper');
+
+// CFG: PAYMENT-DB-WRAPPER-CLASS
+$cfg->setConfigEntry('payment_db_wrapper_class', 'PaymentsDatabaseWrapper');
+
/******************************************************************************
* Console client *
******************************************************************************/
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @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 BaseCityAction 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 city
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 BaseCityAction 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
+ */
+ protected 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]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An action for the welcome page
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 HtmlCityLoginWelcomeAction extends BaseCityAction 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 static final function createHtmlCityLoginWelcomeAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new HtmlCityLoginWelcomeAction();
+
+ // Set the resolver instance
+ $actionInstance->setResolverInstance($resolverInstance);
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo 0% done
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here...
+ }
+
+ /**
+ * 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]
+?>
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2015 Ship-Simu Developer Team
+ * @copyright Copyright (c) 2015 City Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2015 Ship-Simu Developer Team
+ * @copyright Copyright (c) 2015 City Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
--- /dev/null
+<?php
+/**
+ * Controller for login form with password reminder and maybe enabled
+ * "guest-login" button
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityHtmlLoginController 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 static final function createCityHtmlLoginController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new CityHtmlLoginController();
+
+ // Set the command resolver
+ $controllerInstance->setResolverInstance($resolverInstance);
+
+ // 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) {
+ // Generic pre-post command execution
+ $this->executeGenericPrePostCommand($requestInstance, $responseInstance);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * Controller for login area with news
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityHtmlLoginAreaController extends BaseController implements Controller {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Init additional filter chains
+ foreach (array('shutdown') as $filterChain) {
+ $this->initFilterChain($filterChain);
+ } // END - foreach
+ }
+
+ /**
+ * 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 morer filters to this controller
+ */
+ public static final function createCityHtmlLoginAreaController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new CityHtmlLoginAreaController();
+
+ // Set the command resolver
+ $controllerInstance->setResolverInstance($resolverInstance);
+
+ // User auth filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+ // User update filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+
+ // News fetcher filter
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+
+ // News proccess/display-preparation
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+ // 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) {
+ /*
+ * Generic execute of the command: pre and post filters with redirect
+ * but request becomes valid after pre-filters run.
+ */
+ $this->genericHanleRequestLoginAreaFailedRedirect($requestInstance, $responseInstance);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A special guest login class for City
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityGuestLogin extends BaseFrameworkSystem implements LoginableUser {
+ /**
+ * The hashed password
+ */
+ private $hashedPassword = '';
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this login class
+ *
+ * @return $loginInstance An instance of this login class
+ */
+ public static final function createCityGuestLogin () {
+ // Get a new instance
+ $loginInstance = new CityGuestLogin();
+
+ // Return the instance
+ return $loginInstance;
+ }
+
+ /**
+ * Logins the user with the given request containing the credential. The
+ * result of the login can be thrown by exception or, if prefered stored
+ * in a boolean attribute which is then readable by a matching getter.
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @param $responseInstance An instance of a Responseable class
+ * @return void
+ * @throws UserAuthMethodException If wether username nor email login
+ * was detected
+ * @throws MissingMethodException If a method was not found in the
+ * User class
+ * @throws UserPasswordMismatchException If the supplied password did not
+ * match with the stored password
+ */
+ public function doLogin (Requestable $requestInstance, Responseable $responseInstance) {
+ // By default no method is selected
+ $method = null;
+ $data = "";
+
+ // Detect login method (username or email) and try to get a userinstance
+ if (!is_null($requestInstance->getRequestElement('user'))) {
+ // Username found!
+ $method = 'createGuestByUsername';
+ $data = $requestInstance->getRequestElement('user');
+ } // END - if
+
+ // Is a method detected?
+ if (is_null($method)) {
+ // Then abort here
+ throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD);
+ } elseif (!method_exists($this->getConfigInstance()->getConfigEntry('guest_class'), $method)) {
+ // The method is invalid!
+ throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD);
+ }
+
+ // Get a user instance
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), $method), array($data));
+
+ // Remember this new instance in registry
+ Registry::getRegistry()->addInstance('user', $userInstance);
+
+ // Is the password correct?
+ if ($userInstance->ifPasswordHashMatches($requestInstance) === false) {
+ // Mismatching password
+ throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
+ } // END - if
+
+ // Now do the real login. This can be cookie- or session-based login
+ // which depends on the admins setting then on the user's taste.
+ // 1) Get a login helper instance
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance));
+
+ // 2) Execute the login. This will now login...
+ $helperInstance->executeLogin($responseInstance);
+ }
+
+ /**
+ * Determines wether the login was fine. This is done by checking if 'login' instance is in registry
+ *
+ * @return $loginDone Wether the login was fine or not
+ */
+ public function ifLoginWasSuccessfull () {
+ // Is the registry key there?
+ $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable);
+
+ // Return the result
+ return $loginDone;
+ }
+
+ /**
+ * Encrypt given request key or throw an exception if key was not found in
+ * request
+ *
+ * @param $requestKey Key in request class
+ * @return void
+ */
+ public function encryptPassword ($requestKey) {
+ // Check if password is found in request
+ if ($this->getRequestInstance()->isRequestElementSet($requestKey)) {
+ // So encrypt the password and store it for later usage in
+ // the request:
+
+ // Get the plain password
+ $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey);
+
+ // Get user instance
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Get a crypto helper and hash the password
+ $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash());
+
+ // Store the hash back in request
+ $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A special login class for City
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityUserLogin extends BaseFrameworkSystem implements LoginableUser {
+ /**
+ * The hashed password
+ */
+ private $hashedPassword = '';
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this login class
+ *
+ * @return $loginInstance An instance of this login class
+ */
+ public static final function createCityUserLogin () {
+ // Get a new instance
+ $loginInstance = new CityUserLogin();
+
+ // Return the instance
+ return $loginInstance;
+ }
+
+ /**
+ * Logins the user with the given request containing the credential. The
+ * result of the login can be thrown by exception or, if prefered stored
+ * in a boolean attribute which is then readable by a matching getter.
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @param $responseInstance An instance of a Responseable class
+ * @return void
+ * @throws UserPasswordMismatchException If the supplied password did not
+ * match with the stored password
+ * @todo We need to add something here which will make more than one
+ * @todo guest logins, users who are online but based on the same
+ * @todo user account.
+ */
+ public function doLogin (Requestable $requestInstance, Responseable $responseInstance) {
+ // By default no method is selected
+ $method = null;
+ $data = "";
+
+ // Get member class
+ $userClass = $this->getConfigInstance()->getConfigEntry('user_class');
+
+ // Get a user instance
+ $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
+
+ // Remember this new instance in registry
+ Registry::getRegistry()->addInstance('user', $userInstance);
+
+ // Is the password correct?
+ if ($userInstance->ifPasswordHashMatches($requestInstance) === false) {
+ // Mismatching password
+ throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
+ } // END - if
+
+ // ToDo place
+
+ // Now do the real login. This can be cookie- or session-based login
+ // which depends on the admins setting then on the user's taste.
+ // 1) Get a login helper instance
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance));
+
+ // 2) Execute the login. This will now login...
+ $helperInstance->executeLogin($responseInstance);
+ }
+
+ /**
+ * Determines wether the login was fine. This is done by checking if 'login' instance is in registry
+ *
+ * @return $loginDone Wether the login was fine or not
+ */
+ public function ifLoginWasSuccessfull () {
+ // Is the registry key there?
+ $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable);
+
+ // Return the result
+ return $loginDone;
+ }
+
+ /**
+ * Encrypt given request key or throw an exception if key was not found in
+ * request
+ *
+ * @param $requestKey Key in request class
+ * @return void
+ */
+ public function encryptPassword ($requestKey) {
+ // Check if password is found in request
+ if ($this->getRequestInstance()->isRequestElementSet($requestKey)) {
+ // So encrypt the password and store it for later usage in
+ // the request:
+
+ // Get the plain password
+ $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey);
+
+ // Get user instance
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Get a crypto helper and hash the password
+ $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash());
+
+ // Store the hash back in request
+ $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A helper for City to login. This login helper first checks what setting
+ * (cookie or session) the admin has choosen then overwrites it with the setting
+ * from current user. The registry instance should hold an instance of this user
+ * class at key 'user' else an exception will be thrown. After this the setting
+ * from a login form will be taken as login method and be stored in database
+ * for later usage.
+ *
+ * The user shall be able to choose "Default login method" or similar to use his
+ * own login method.
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityLoginHelper extends BaseLoginHelper implements HelpableLogin {
+ /**
+ * The login method we shall choose
+ */
+ private $authMethod = '';
+
+ // Exception constants
+ const EXCEPTION_INVALID_USER_INSTANCE = 0x190;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class by given request instance
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @return $helperInstance An instance of this helper class
+ * @throws UserInstanceMissingException If the user instance in registry
+ * is missing or invalid
+ */
+ public static final function createCityLoginHelper (Requestable $requestInstance) {
+ // Get a new instance first
+ $helperInstance = new CityLoginHelper();
+
+ // Get a user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Is this instance valid?
+ if (!$userInstance instanceof ManageableAccount) {
+ // Thrown an exception here
+ throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE);
+ } // END - if
+
+ // Set default login method from config
+ $helperInstance->setDefaultAuthMethod();
+
+ // Set request instance
+ $helperInstance->setRequestInstance($requestInstance);
+
+ // Return the prepared instance
+ return $helperInstance;
+ }
+
+ /**
+ * Setter for default login method from config
+ *
+ * @return void
+ */
+ protected function setDefaultAuthMethod () {
+ $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class');
+ }
+
+ /**
+ * Execute the login request by given response instance. This instance can
+ * be used for sending cookies or at least the session id out.
+ *
+ * @param $responseInstance An instance of a Responseable class
+ * @return void
+ */
+ public function executeLogin (Responseable $responseInstance) {
+ // Get an instance from the login method
+ $loginInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance));
+
+ // Set user cookie
+ $loginInstance->setUserAuth($this->getRequestInstance()->getRequestElement('username'));
+
+ // Set password cookie
+ $loginInstance->setPasswordAuth($this->getRequestInstance()->getRequestElement('pass_hash'));
+
+ // Remember this login instance for later usage
+ Registry::getRegistry()->addInstance('login', $loginInstance);
+ }
+}
+
+//
+?>
--- /dev/null
+<?php
+/**
+ * A ??? menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @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 City???Menu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public final static function createCity???Menu () {
+ // Get a new instance
+ $menuInstance = new City???Menu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A Confirm menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityConfirmMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityConfirmMenu () {
+ // Get a new instance
+ $menuInstance = new CityConfirmMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityLoginAreaMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityLoginAreaMenu () {
+ // Get a new instance
+ $menuInstance = new CityLoginAreaMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A LoginFailed menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityLoginFailedMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityLoginFailedMenu () {
+ // Get a new instance
+ $menuInstance = new CityLoginFailedMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityLoginMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityLoginMenu () {
+ // Get a new instance
+ $menuInstance = new CityLoginMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityLogoutMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityLogoutMenu () {
+ // Get a new instance
+ $menuInstance = new CityLogoutMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A Status menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityStatusMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityStatusMenu () {
+ // Get a new instance
+ $menuInstance = new CityStatusMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A menu class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityGovernmentFailedAreaMenu extends BaseMenu implements RenderableMenu {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $menuInstance An instance of this class
+ */
+ public static final function createCityGovernmentFailedAreaMenu () {
+ // Get a new instance
+ $menuInstance = new CityGovernmentFailedAreaMenu();
+
+ // Return the prepared instance
+ return $menuInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A user registration class specially for City
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2015 City Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 CityRegistration extends BaseRegistration implements UserRegister {
+ /**
+ * Hashed password
+ */
+ private $hashedPassword = '';
+
+ /**
+ * Elements for criteria
+ */
+ private $criteriaElements = array(
+ 'username',
+ 'pass_hash',
+ 'email' => 'email1',
+ 'surname',
+ 'family',
+ 'street',
+ 'zip',
+ 'city',
+ 'icq',
+ 'jabber',
+ 'yahoo',
+ 'aol',
+ 'msn',
+ 'birth_day',
+ 'birth_month',
+ 'birth_year'
+ );
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Create a new instance
+ *
+ * @return $registrationInstance An instance of this registration class
+ */
+ public static final function createCityRegistration () {
+ // Get a new instance
+ $registrationInstance = new CityRegistration();
+
+ // Initialize the filter chains
+ $registrationInstance->initFilterChains();
+
+ // And return it
+ return $registrationInstance;
+ }
+
+ /**
+ * Encrypt given request key or throw an exception if key was not found in
+ * request
+ *
+ * @param $requestKey Key in request class
+ * @return void
+ */
+ public function encryptPassword ($requestKey) {
+ // Check if password is found in request
+ if ($this->getRequestInstance()->isRequestElementSet($requestKey)) {
+ // So encrypt the password and store it for later usage in
+ // the request:
+
+ // 1.: Get the plain password
+ $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey);
+
+ // 2. Get a crypto helper and hash the password
+ $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword);
+
+ // 3. Store the hash back in request
+ $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
+ }
+ }
+
+ /**
+ * Perform things like informing assigned affilates about new registration
+ * before registration
+ *
+ * @return void
+ * @todo Maybe add more things to perform
+ */
+ public function doPreRegistration () {
+ // First run all pre filters
+ $this->executePreFilters();
+ }
+
+ /**
+ * Registers the new user account by insterting the request data into the
+ * database and paying some start credits or throw exceptions if this fails
+ *
+ * @return void
+ * @todo Maybe add more things to perform
+ */
+ public function registerNewUser () {
+ // Get a user database wrapper
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+ // Use this instance to insert the whole registration instance
+ $wrapperInstance->insertRegistrationObject($this);
+ }
+
+ /**
+ * Perform things like notifying partner websites after registration is done
+ *
+ * @return void
+ * @todo Maybe add more things to perform
+ */
+ public function doPostRegistration () {
+ // First run all post filters
+ $this->executePostFilters();
+ }
+
+ /**
+ * Do the action which is required after all registration steps are done.
+ * This can be a simple redirect to another webpage or displaying a message
+ * to the user. Or this can be a login step into the newly created account.
+ *
+ * @return void
+ */
+ public function doPostAction () {
+ // Get an action instance from our factory
+ $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_class');
+
+ // Execute the action
+ $actionInstance->execute($this->getRequestInstance(), $this->getResponseInstance());
+ }
+
+ /**
+ * Adds registration elements to a given dataset instance
+ *
+ * @param $criteriaInstance An instance of a StoreableCriteria class
+ * @param $requestInstance An instance of a Requestable class
+ * @return void
+ */
+ public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) {
+ // Default is unconfirmed!
+ $configEntry = 'user_status_unconfirmed';
+
+ // Is the confirmation process entirely disabled?
+ if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === 'N') {
+ // No confirmation of email needed
+ $configEntry = 'user_status_confirmed';
+ } // END - if
+
+ // Add a lot elements to the dataset criteria
+ foreach ($this->criteriaElements as $alias => $element) {
+ // Do we have an alias?
+ if (is_string($alias)) {
+ // Yes, so use it
+ $criteriaInstance->addCriteria($alias, $this->getRequestInstance()->getRequestElement($element));
+
+ // Debug message
+ //* DEBUG: */ $this->debugOutput('ALIAS: alias='.$alias.',element='.$element.'='.$this->getRequestInstance()->getRequestElement($element));
+ } else {
+ // No, default entry
+ $criteriaInstance->addCriteria($element, $this->getRequestInstance()->getRequestElement($element));
+
+ // Debug message
+ //* DEBUG: */ $this->debugOutput('DEFAULT: element='.$element.'='.$this->getRequestInstance()->getRequestElement($element));
+ }
+
+ // Is this a guest account?
+ if ((($element == 'username') || ($alias == 'username')) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) {
+ // Yes, then set the config entry to guest status
+ $configEntry = 'user_status_guest';
+ } // END - if
+ } // END - foreach
+
+ // Mark the username as unique key
+ $criteriaInstance->setUniqueKey(UserDatabaseWrapper::DB_COLUMN_USERNAME);
+
+ // Add account status as configured
+ $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry);
+
+ // Include registration timestamp
+ $criteriaInstance->addCriteria('registered', date('Y-m-d H:i:s', time()));
+ }
+}
+
+//
+?>
--- /dev/null
+<?php
+// Get form helper instance
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_government_startup'));
+
+// Prefetch user instance
+$helperInstance->prefetchValueInstance('user');
+
+// Add main form group
+$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen! (Die Profildaten sollte jedoch echt sein.)");
+
+// Add group for personal data
+$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Beantragung nötig sind:");
+
+// Display email, surname and family name
+$helperInstance->addFormNote('surname', "Vorname: <span class=\"persona_data\">".$helperInstance->getValueField('surname')."</span>");
+$helperInstance->addFormNote('family', "Nachname: <span class=\"persona_data\">".$helperInstance->getValueField('family')."</span>");
+$helperInstance->addFormNote('email', "Email-Adresse: <span class=\"persona_data\">".$helperInstance->getValueField('email')."</span>");
+$helperInstance->addFormNote('birthday', "Geburtstag: <span class=\"persona_data\">".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year')."</span>");
+
+// Add link placeholder for profile page
+$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?city_profile?}");
+
+// Ask again for current account password
+$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein.");
+$helperInstance->addFieldText('password', "Derzeitiges Passwort:");
+$helperInstance->addInputPasswordField('password');
+
+// CAPTCHA enabled?
+if ($helperInstance->ifFormSecuredWithCaptcha()) {
+ $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst.");
+ $helperInstance->addCaptcha();
+} // END - if
+
+// Final notices
+$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
+$helperInstance->addInputResetButton("Alles nochmal eingeben");
+$helperInstance->addInputSubmitButton("Starthilfe beantragen");
+$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz".");
+
+// Flush the finished form
+$helperInstance->flushContent();
+
+// Get link helper for profile link
+$linkInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'city_profile'));
+
+// Add action
+$linkInstance->addActionLinkById('profile', 'profile');
+
+// Flush the finished form
+$linkInstance->flushContent();
+
+// [EOC]
+?>
+<div id="government_frame">
+ <div id="government_header">
+ Virtuelle Beantragung von Starthilfe
+ </div>
+
+ <div id="government_form">
+ {?city_government_startup?}
+ </div>
+</div>
--- /dev/null
+<?php
+// Get form helper instance
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_government_training'));
+
+// Prefetch user instance
+$helperInstance->prefetchValueInstance('user');
+
+// Add main form group
+$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!");
+
+// Add group for personal data
+$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Kursusteilnahme nötig sind:");
+
+// Ask again for current account password
+$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein.");
+$helperInstance->addFieldText('password', "Derzeitiges Passwort:");
+$helperInstance->addInputPasswordField('password');
+
+// Display email, surname and family name
+$helperInstance->addFormNote('surname', "Vorname: <span class=\"persona_data\">".$helperInstance->getValueField('surname')."</span>");
+$helperInstance->addFormNote('family', "Nachname: <span class=\"persona_data\">".$helperInstance->getValueField('family')."</span>");
+$helperInstance->addFormNote('email', "Email-Adresse: <span class=\"persona_data\">".$helperInstance->getValueField('email')."</span>");
+$helperInstance->addFormNote('birthday', "Geburtstag: <span class=\"persona_data\">".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year')."</span>");
+
+// Add link placeholder for profile page
+$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?city_profile?}");
+
+// CAPTCHA enabled?
+if ($helperInstance->ifFormSecuredWithCaptcha()) {
+ $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung eines Trainingkursus ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, um den Trainingskursus zu beantragen.");
+ $helperInstance->addCaptcha();
+} // END - if
+
+// Final notices
+$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
+$helperInstance->addInputResetButton("Alles nochmal eingeben");
+$helperInstance->addInputSubmitButton("Trainingskurs beantragen");
+$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz".");
+
+// Flush the finished form
+$helperInstance->flushContent();
+
+// Get link helper for profile link
+$linkInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'city_profile'));
+
+// Add action
+$linkInstance->addActionLinkById('profile', 'profile');
+
+// Flush the finished form
+$linkInstance->flushContent();
+
+// [EOC]
+?>
+<div id="government_frame">
+ <div id="government_header">
+ Virtuelle Beantragung eines Training-Kursus
+ </div>
+
+ <div id="government_form">
+ {?city_government_training?}
+ </div>
+</div>
--- /dev/null
+<?php
+// Get helper instance
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'logout_now'));
+
+// Set link text
+$helperInstance->addLinkWithTextById('logout_now');
+
+// Flush the content
+$helperInstance->flushContent();
+
+// Get helper instance
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'return_login'));
+
+// Set link text
+$helperInstance->addLinkWithTextById('return_login');
+
+// Flush the content
+$helperInstance->flushContent();
+
+// [EOC]
+?>
+<div id="logout_box">
+ <div id="logout_header">
+ Willst du dich wirklich aus dem Spiel ausloggen?
+ </div>
+
+ <div id="logouts">
+ {?logout_now?} | {?return_login?}
+ </div>
+</div>
--- /dev/null
+<?php
+// Get helper instance for web forms. This will add the opening form-tag to
+// the helper's render cache which is simply a small variable in the class
+// BaseHelper.
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, "city_profile"));
+
+// Pre-fetch field data with a given registry key
+$helperInstance->prefetchValueInstance('user');
+
+// Password can only be changed when the old one is entered and new one twice!
+$helperInstance->addFormGroup('pass', "Neues Passwort einrichten:");
+$helperInstance->addFormSubGroup('pass', "Bitte gebe zum Ändern deines Passwortes zweimal das gewünschte neue Passwort ein.");
+$helperInstance->addFieldText('pass1', "Neues Passwort:");
+$helperInstance->addInputPasswordField('pass1');
+$helperInstance->addFieldText('pass2', "Neues Passwort, Wiederholung:");
+$helperInstance->addInputPasswordField('pass2');
+
+// Display current email
+$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: <span class=\"persona_data\">".$helperInstance->getValueField('email')."</span>");
+
+// Only for changing email address
+if ($helperInstance->ifEmailChangeAllowed()) {
+ $helperInstance->addFormGroup('email', "Änderung deiner Email-Addresse:");
+ $helperInstance->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese ändern möchtest!");
+ $helperInstance->addFieldText('email1', "Email-Adresse:");
+ $helperInstance->addInputTextField('email1');
+ $helperInstance->addFieldText('email2', "Wiederholung Email-Adresse:");
+ $helperInstance->addInputTextField('email2');
+
+ if ($helperInstance->ifEmailMustBeUnique()) {
+ $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein.");
+ } // END - if
+
+ if ($helperInstance->ifEmailChangeRequireConfirmation()) {
+ $helperInstance->addFormNote('confirm', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an.");
+ } // END - if
+} // END - if
+
+// Add form group for user profile
+$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern.");
+
+// Persoenliche Daten mit in der Anmeldung abfragen?
+if ($helperInstance->ifRegisterIncludesPersonaData()) {
+ $helperInstance->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen.");
+ $helperInstance->addFieldText('surname', "Dein Vorname:");
+ $helperInstance->addInputTextFieldWithDefault('surname');
+ $helperInstance->addFieldText('family', "Dein Nachname:");
+ $helperInstance->addInputTextFieldWithDefault('family');
+ $helperInstance->addFieldText('street', "Strasse und Hausnummer:");
+ $helperInstance->addInputTextFieldWithDefault('street');
+ $helperInstance->addFieldText('city', "Wohnort:");
+ $helperInstance->addInputTextFieldWithDefault('city');
+
+ // Include birthday?
+ if ($helperInstance->ifProfileIncludesBirthDay()) {
+ $helperInstance->addFormSubGroup('birthday', "Verrate uns doch dein Geburtsdatum, als Dankeschön erhälst du interessante Prämien - ausschliesslich per Email - zum Geburtstag zugesandt! Gültiges Format: TT.MM.JJJJ");
+ $helperInstance->addInputTextField('birth_day');
+ $helperInstance->addFieldText('birth_day', ".");
+ $helperInstance->addInputTextField('birth_month');
+ $helperInstance->addFieldText('birth_day', ".");
+ $helperInstance->addInputTextField('birth_year');
+ } // END - if
+} // END - if
+
+// Add sub group for zip code
+$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?");
+$helperInstance->addFieldText('zip', "Postleitzahl:");
+$helperInstance->addInputTextFieldWithDefault('zip');
+
+// Add sub group for chat protocols
+$helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:");
+
+// Add ICQ chat?
+if ($helperInstance->ifChatEnabled('icq')) {
+ $helperInstance->addFieldText('icq', "ICQ-Nummer:");
+ $helperInstance->addInputTextFieldWithDefault('icq');
+} // END - if
+
+// Add Jabber chat?
+if ($helperInstance->ifChatEnabled('jabber')) {
+ $helperInstance->addFieldText('jabber', "Jabber:");
+ $helperInstance->addInputTextFieldWithDefault('jabber');
+} // END - if
+
+// Add Yahoo! chat?
+if ($helperInstance->ifChatEnabled('yahoo')) {
+ $helperInstance->addFieldText('yahoo', "Yahoo!:");
+ $helperInstance->addInputTextFieldWithDefault('yahoo');
+} // END - if
+
+// Add AOL chat?
+if ($helperInstance->ifChatEnabled('aol')) {
+ $helperInstance->addFieldText('aol', "AOL-Screenname:");
+ $helperInstance->addInputTextFieldWithDefault('aol');
+} // END - if
+
+// Add MSN chat?
+if ($helperInstance->ifChatEnabled('msn')) {
+ $helperInstance->addFieldText('msn', "MSN:");
+ $helperInstance->addInputTextFieldWithDefault('msn');
+} // END - if
+
+if (!$helperInstance->ifRegisterRequiresEmailVerification()) {
+ $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per Email sind im Loginbereich verfeinerbar, welche du genau haben willst.");
+} // END - if
+
+// Rules already accepted?
+if ($helperInstance->ifRulesHaveChanged()) {
+ $helperInstance->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an.");
+ $helperInstance->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:");
+ $helperInstance->addInputCheckboxField('rules', false);
+} else {
+ $helperInstance->addFormNote('rules_accepted', "Du hast die aktuellen Spielregeln akzeptiert. Vielen Dank!");
+ $helperInstance->addInputHiddenField('rules', "1");
+}
+
+// CAPTCHA enabled?
+if ($helperInstance->ifFormSecuredWithCaptcha()) {
+ $helperInstance->addFormGroup('captcha_user', "Das Ändern von Profildaten ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit deine Änderungen gespeichert werden können.");
+ $helperInstance->addCaptcha();
+} // END - if
+
+// Ask again for current account password
+$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein.");
+$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:");
+$helperInstance->addInputPasswordField('pass_old');
+
+// Final notices
+$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
+$helperInstance->addInputResetButton("Alles nochmal eingeben");
+$helperInstance->addInputSubmitButton("Accountdaten aktualisieren");
+$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz".");
+
+// Flush finished form
+$helperInstance->flushContent();
+
+// [EOC]
+?>
+<div id="content_header">
+ Deine Profildaten bearbeiten
+</div>
+
+<div id="profile_box">
+ {?city_profile?}
+</div>
--- /dev/null
+<?php
+// Get helper instance for web forms. This will add the opening form-tag to
+// the helper's render cache which is simply a small variable in the class
+// BaseHelper.
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'resend_link'));
+
+// Pre-fetch field data with a given registry key
+$helperInstance->prefetchValueInstance('user');
+
+// Add submit button or notice
+if ($helperInstance->ifUserAccountUnconfirmed()) {
+ // Add submit button
+ $helperInstance->addInputHiddenFieldWithDefault('email');
+ $helperInstance->addInputSubmitButton("Bestätigungslink erneut aussenden");
+} elseif ($helperInstance->ifUserAccountLocked()) {
+ // Account is locked
+ $helperInstance->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre:
+ <span id=\"lock_reason\">".$helperInstance->getValueField('lock_reason')."</span>
+ Bitte melde dich beim Support, damit dieser dir weiterhelfen kann."
+ );
+} elseif ($helperInstance->ifUserAccountGuest()) {
+ // Account is guest account
+ $helperInstance->addFormNote('status_guest', "Gästeaccounts sind in der Funktionalität
+ leicht eingeschränkt. Bitte melde dich an, damit du ein
+ vollwertiges Account bekommst."
+ );
+}
+
+// Flush content and automatically close the form
+$helperInstance->flushContent();
+
+// Build the form for confirmation
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'confirm_code'));
+
+// Pre-fetch field data with a given registry key
+$helperInstance->prefetchValueInstance('user');
+
+if ($helperInstance->ifUserAccountUnconfirmed()) {
+ // Add code box
+ $helperInstance->addFormGroup('code', "Bitte gebe hier den Bestätigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen.");
+ $helperInstance->addFieldText('code', "Bestätigungscode aus der Mail:");
+ $helperInstance->addInputTextField('code');
+
+ // Add submit button
+ $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!");
+ $helperInstance->addInputResetButton("Nochmal eingeben");
+ $helperInstance->addInputSubmitButton("Bestätigungscode absenden");
+} else {
+ // Add message
+ $helperInstance->addFormNote('status_not_unconfirmed', "Möglicherweise hast du einen Bestätigungslink angeklickt, obwohl dein Account bereits freigegeben oder gesperrt ist.");
+}
+
+// Flush content and automatically close the form
+$helperInstance->flushContent();
+
+// [EOC]
+?>
+<div id="content_header">
+ Problem mit deinem Account gefunden:
+</div>
+
+<div id="status_box">
+ Du bist möglicherweise für deine ausgewählte Aktion nicht
+ berechtigt oder du hast noch deine Email-Adresse nicht bestätigt. Du
+ kannst dir nun den Bestätigungslink erneut aussenden lassen, oder den
+ Bestätigungscode unten eingeben.
+
+ <div id="resend_link_box">
+ {?resend_link?}
+ </div>
+
+ <div id="confirm_code_header">
+ Weitere Möglichkeiten:
+ </div>
+
+ <div id="confirm_code_box">
+ {?confirm_code?}
+ </div>
+</div>
--- /dev/null
+<div id="news_frame">
+ {?city_login_news?}
+</div>
--- /dev/null
+<?php
+// Get a helper instance for the profile link (and maybe later more!)
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'profile'));
+
+// Prefetch user instance
+$helperInstance->prefetchValueInstance('user');
+
+// Flush the content out
+$helperInstance->flushContent();
+
+// [EOC]
+?>
+<div id="user_name_div" class="block_cell">
+ Spielername: <span id="user_name">{?block_username?}</span>
+</div>
+<div id="user_status_div" class="block_cell">
+ Spielerstatus: <span id="user_status">{?block_user_status?}</span>
+</div>
+<div id="user_points_div" class="block_cell">
+ {?currency?}: <span id="user_points">{?block_points?}</span>
+</div>
+<div id="user_profile_div" class="block_cell">
+ {?profile?}
+</div>
+<div id="user_registered_div" class="block_cell">
+ Angemeldet seit: <span id="registered">{?block_registered?}</span>
+</div>
<?php
// Get a helper instance without a form tag
-$captchaHelper = ObjectFactory::createObjectByConfiguredName('html_form_helper', array($this, 'captcha_code', false, false));
+$captchaHelper = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'captcha_code', false, false));
// Add input field with text for CAPTCHA code
$captchaHelper->addFieldText('captcha_code', "Bitte wiederhole den Code:");
{?header?}
<div id="master">
- <div class="menu" id="menu">
- {?menu_content?}
- </div>
+<div id="main_header">
+ {?city_header?}
+</div>
+
+<div id="menu">
+ {?menu?}
+</div>
+
+<div id="advert">
+ {?nav_advert?}
+</div>
- <div id="main_header">
- {?city_header?}
- </div>
+<div id="language">
+ {?language_selector?}
+</div>
- <div class="main_content" id="main_content">
- {?main_content?}
- </div>
+<div id="main_content">
+ {?content?}
+</div>
- <div id="main_footer">
- {?city_footer?}
- </div>
+<div id="main_footer">
+ {?city_footer?}
+</div>
</div>
{?footer?}
--- /dev/null
+<?php
+///////////////////////////////
+// Assign personal user data //
+///////////////////////////////
+
+// Get a new instance for personal data
+$blockInstance = ObjectFactory::createObjectByConfiguredName('html_block_helper_class', array($this, 'persona_data'));
+
+// Set the data source instance which must exist in registry
+$blockInstance->prefetchValueInstance('user', 'user_points');
+
+// Assign fields with template variables
+$blockInstance->assignField('username');
+$blockInstance->assignFieldWithFilter('user_status', 'user_status_translator');
+$blockInstance->assignFieldWithFilter('points', 'format_number');
+
+// Shall we include registration date?
+if ($blockInstance->ifIncludeRegistrationStamp()) {
+ // Then assign it as well!
+ $blockInstance->assignFieldWithFilter('registered', 'format_timestamp');
+} // END - if
+
+// Flush the content out to a template variable
+$blockInstance->flushContent();
+
+// Get helper instance
+$linkInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'logout'));
+
+// Add action
+$linkInstance->addActionLinkById('logout', 'logout');
+
+// Flush the content
+$linkInstance->flushContent();
+
+// [EOC]
+?>
+<div id="content_header">
+ Willkommen im Loginbereich von <span class="app_name">{?app_full_name?}</span>!
+</div>
+
+<div id="content_body">
+ {?login_content?}
+</div>
+
+<div id="persona_data" title="Informationen zu Deinem Spieleaccount">
+ <div id="persona_header">
+ Account-Infos:
+ </div>
+
+ <div id="persona_body">
+ {?persona_data?}
+ </div>
+
+ <div id="logout">
+ {?logout?}
+ </div>
+</div>
// Get helper instance for web forms. This will add the opening form-tag to
// the helper's render cache which is simply a small variable in the class
// BaseHelper.
-$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper', array($this, 'city_register'));
+$helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_register'));
// Always ask at least for nickname and password
$helperInstance->addFormGroup('login', "Bitte gebe hier gewünschten Nickname und dein Zugangspasswort ein.");
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+Login area menu entries. You should leave this template for smooth upgrades.
+
+@author Roland Haeder <webmaster@ship-simu.org>
+@version 0.0.0
+@copyright Copyright (c) 2015 City Developer Team
+@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/>
+//-->
+<menu>
+ <block-list block-count="{?block_count?}">
+ <block>
+ <block-header>
+ <title>
+ <title-id><![CDATA[home_menu_title]]></title-id>
+ <title-class><![CDATA[menu_title]]></title-class>
+ <title-text><![CDATA[Home:]]></title-text>
+ </title>
+ </block-header>
+ <entry-list entry-count="{?entry_count?}">
+ <entry>
+ <entry-id><![CDATA[overview_entry]]></entry-id>
+ <anchor>
+ <anchor-id><![CDATA[menu_overview]]></anchor-id>
+ <anchor-text><![CDATA[Home]]></anchor-text>
+ <anchor-title><![CDATA[Zur Übersichtsseite]]></anchor-title>
+ <anchor-href><![CDATA[index.php?app={?app_short_name?}&command=login_area]]></anchor-href>
+ </anchor>
+ </entry>
+ <entry>
+ <entry-id><![CDATA[pillory_entry]]></entry-id>
+ <anchor>
+ <anchor-id><![CDATA[menu_pillory]]></anchor-id>
+ <anchor-text><![CDATA[Pranger]]></anchor-text>
+ <anchor-title><![CDATA[Zum Pranger]]></anchor-title>
+ <anchor-href><![CDATA[index.php?app={?app_short_name?}&command=pillory]]></anchor-href>
+ </anchor>
+ </entry>
+ </entry-list>
+ <block-footer>
+ <footer-id><![CDATA[overview_menu_footer]]></footer-id>
+ <footer-class><![CDATA[menu_footer]]></footer-class>
+ <footer-text><![CDATA[Unterhalb Hauptauswahl]]></footer-text>
+ </block-footer>
+ </block>
+ <block>
+ <block-header>
+ <title>
+ <title-id><![CDATA[misc_menu_title]]></title-id>
+ <title-class><![CDATA[menu_title]]></title-class>
+ <title-text><![CDATA[Weiteres:]]></title-text>
+ </title>
+ </block-header>
+ <entry-list entry-count="{?entry_count?}">
+ <entry>
+ <entry-id><![CDATA[imprint_entry]]></entry-id>
+ <anchor>
+ <anchor-id><![CDATA[menu_imprint]]></anchor-id>
+ <anchor-text><![CDATA[Impressum]]></anchor-text>
+ <anchor-title><![CDATA[Impressum]]></anchor-title>
+ <anchor-href><![CDATA[index.php?app={?app_short_name?}&command=imprint]]></anchor-href>
+ </anchor>
+ </entry>
+ <entry>
+ <entry-id><![CDATA[terms_entry]]></entry-id>
+ <anchor>
+ <anchor-id><![CDATA[menu_terms]]></anchor-id>
+ <anchor-text><![CDATA[ANBs]]></anchor-text>
+ <anchor-title><![CDATA[Allgemeine Nutzungsbedingungen (=ANBs)]]></anchor-title>
+ <anchor-href><![CDATA[index.php?app={?app_short_name?}&command=terms]]></anchor-href>
+ </anchor>
+ </entry>
+ </entry-list>
+ <block-footer>
+ <footer-id><![CDATA[law_menu_footer]]></footer-id>
+ <footer-class><![CDATA[menu_footer]]></footer-class>
+ <footer-text><![CDATA[Unterhalb Weiteres]]></footer-text>
+ </block-footer>
+ </block>
+ </block-list>
+</menu>
-Subproject commit bbb4031b65beb69a02f8c476ae4cdc36da851d84
+Subproject commit 4d41d3384681ba250309b7c71948968938f8df5b
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all