From: Roland Haeder Date: Tue, 7 Apr 2015 21:34:18 +0000 (+0200) Subject: Added a lot stuff for confirming email address and resending confirmation link. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9e1e397d62d8198f09af466e9a2d6909054817e5;p=city.git Added a lot stuff for confirming email address and resending confirmation link. Yes, all is generic stuff (what happens with every browser-based game or application) so let's finish this quickly. Signed-off-by: Roland Haeder --- diff --git a/application/city/config.php b/application/city/config.php index de73d49..c0d7664 100644 --- a/application/city/config.php +++ b/application/city/config.php @@ -80,6 +80,12 @@ $cfg->setConfigEntry('news_reader_register_class', 'DefaultNewsReader'); // CFG: NEWS-READER-LOGIN-AREA-CLASS $cfg->setConfigEntry('news_reader_login_area_class', 'DefaultNewsReader'); +// CFG: NEWS-READER-LOGIN-AREA-PROFILE-CLASS +$cfg->setConfigEntry('news_reader_login_area_profile_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-STATUS-PROBLEM-CLASS +$cfg->setConfigEntry('news_reader_login_area_status_problem_class', 'DefaultNewsReader'); + // CFG: NEWS-HOME-LIMIT $cfg->setConfigEntry('news_home_limit', 10); @@ -227,23 +233,20 @@ $cfg->setConfigEntry('random_string_length', 100); // CFG: IMAGE-TEMPLATE-CLASS $cfg->setConfigEntry('image_template_class', 'ImageTemplateEngine'); -// CFG: CAPTCHA-ENCRYPT-VALIDATOR-FILTER -$cfg->setConfigEntry('captcha_encrypt_validator_filter', 'CaptchaEncryptFilter'); +// CFG: MAIL-TEMPLATE-CLASS +$cfg->setConfigEntry('mail_template_class', 'MailTemplateEngine'); -// 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 EMAIl-TPL-RESEND-LINK +$cfg->setConfigEntry('email_tpl_resend_link', 'text'); -// CFG: CITY-HTML-CMD-CONFIRM-RESOLVER-CLASS -$cfg->setConfigEntry('city_html_cmd_confirm_resolver_class', 'HtmlCommandResolver'); +// CFG: ADMIN-EMAIL +$cfg->setConfigEntry('admin_email', 'you@some-hoster.invalid'); -// CFG: CITY-HTML-CMD-PROBLEM-RESOLVER-CLASS -$cfg->setConfigEntry('city_html_cmd_problem_resolver_class', 'HtmlCommandResolver'); +// CFG: CAPTCHA-ENCRYPT-VALIDATOR-FILTER +$cfg->setConfigEntry('captcha_encrypt_validator_filter', 'CaptchaEncryptFilter'); -// CFG: CITY-HTML-CMD-LOGOUT-RESOLVER-CLASS -$cfg->setConfigEntry('city_html_cmd_logout_resolver_class', 'HtmlCommandResolver'); +// CFG: USER-STATUS-CONFIRMED-FILTER +$cfg->setConfigEntry('user_status_confirmed_filter', 'UserStatusConfimedUpdateFilter'); // CFG: CAPTCHA-GUEST-VERIFIER-FILTER $cfg->setConfigEntry('captcha_guest_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); @@ -272,6 +275,30 @@ $cfg->setConfigEntry('birthday_register_verifier_filter', 'BirthdayVerifierFilte // CFG: BIRTHDAY-PROFILE-VERIFIER-FILTER $cfg->setConfigEntry('birthday_profile_verifier_filter', 'BirthdayVerifierFilter'); +// 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: EMAIL-CHANGE-ALLOWED +$cfg->setConfigEntry('email_change_allowed', 'Y'); + +// CFG: EMAIL-CHANGE-CONFIRMATION +$cfg->setConfigEntry('email_change_confirmation', 'Y'); + +// CFG: GUEST-LOGIN-ALLOWED +$cfg->setConfigEntry('guest_login_allowed', 'Y'); + // CFG: GUEST-LOGIN-USERNAME $cfg->setConfigEntry('guest_login_user', 'guest'); diff --git a/application/city/main/actions/html/class_HtmlCityLoginProfileAction.php b/application/city/main/actions/html/class_HtmlCityLoginProfileAction.php new file mode 100644 index 0000000..d9d704f --- /dev/null +++ b/application/city/main/actions/html/class_HtmlCityLoginProfileAction.php @@ -0,0 +1,82 @@ + + * @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 . + */ +class HtmlCityLoginProfileAction 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 createHtmlCityLoginProfileAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new HtmlCityLoginProfileAction(); + + // 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) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/city/main/actions/html/class_HtmlCityLoginStatusProblemAction.php b/application/city/main/actions/html/class_HtmlCityLoginStatusProblemAction.php new file mode 100644 index 0000000..7d278f2 --- /dev/null +++ b/application/city/main/actions/html/class_HtmlCityLoginStatusProblemAction.php @@ -0,0 +1,82 @@ + + * @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 . + */ +class HtmlCityLoginStatusProblemAction 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 createHtmlCityLoginStatusProblemAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new HtmlCityLoginStatusProblemAction(); + + // 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 method + parent::execute($requestInstance, $responseInstance); + + // Add your code + } + + /** + * 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) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/city/main/controller/html/class_CityHtmlConfirmController.php b/application/city/main/controller/html/class_CityHtmlConfirmController.php new file mode 100644 index 0000000..3d90c4a --- /dev/null +++ b/application/city/main/controller/html/class_CityHtmlConfirmController.php @@ -0,0 +1,73 @@ + + * @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 . + */ +class CityHtmlConfirmController 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 createCityHtmlConfirmController (CommandResolver $resolverInstance) { + // Create the instance + $controllerInstance = new CityHtmlConfirmController(); + + // Set the command resolver + $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')); + + // 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] +?> diff --git a/application/city/templates/de/code/confirm_link.ctp b/application/city/templates/de/code/confirm_link.ctp new file mode 100644 index 0000000..bf8e6a6 --- /dev/null +++ b/application/city/templates/de/code/confirm_link.ctp @@ -0,0 +1,25 @@ +addLinkWithTextById('direct_login'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Bestätigung Deiner Email-Adresse: +
+ +
+ Hallo {?username?}! Du hast heute deine + Email-Addresse bestätigt, wodurch alle Spielefunktionen entsperrt + worden sind. Viel Spass beim Spielen! +
+ + diff --git a/application/city/templates/de/code/mail_debug.ctp b/application/city/templates/de/code/mail_debug.ctp new file mode 100644 index 0000000..e62dd07 --- /dev/null +++ b/application/city/templates/de/code/mail_debug.ctp @@ -0,0 +1,25 @@ +
+ Mail-Debug-Ausgabe: +
+ +
+
+ Von: {?sender?} +
+
+ An: {?recipient?} +
+
+ Betreff: {?subject?} +
+
+ +
+
+ Nachricht: +
+ +
+ {?message?} +
+
diff --git a/application/city/templates/de/emails/.htaccess b/application/city/templates/de/emails/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/city/templates/de/emails/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/city/templates/de/emails/text_resend_link.tpl b/application/city/templates/de/emails/text_resend_link.tpl new file mode 100644 index 0000000..9b79056 --- /dev/null +++ b/application/city/templates/de/emails/text_resend_link.tpl @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/application/city/templates/de/menu/generic_menu_entries.xml b/application/city/templates/de/menu/generic_menu_entries.xml index e048d51..41c8fe9 100644 --- a/application/city/templates/de/menu/generic_menu_entries.xml +++ b/application/city/templates/de/menu/generic_menu_entries.xml @@ -31,6 +31,7 @@ along with this program. If not, see + @@ -41,6 +42,7 @@ along with this program. If not, see + @@ -50,6 +52,7 @@ along with this program. If not, see + @@ -59,6 +62,7 @@ along with this program. If not, see + @@ -68,6 +72,7 @@ along with this program. If not, see + @@ -78,12 +83,14 @@ along with this program. If not, see + + @@ -92,6 +99,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/> <title-text><![CDATA[Rechtliches:]]></title-text> + @@ -102,6 +110,7 @@ along with this program. If not, see + @@ -112,6 +121,7 @@ along with this program. If not, see + diff --git a/application/city/templates/de/menu/login_area_menu_entries.xml b/application/city/templates/de/menu/login_area_menu_entries.xml index c93c2e5..efe4db3 100644 --- a/application/city/templates/de/menu/login_area_menu_entries.xml +++ b/application/city/templates/de/menu/login_area_menu_entries.xml @@ -31,6 +31,7 @@ along with this program. If not, see + @@ -41,13 +42,55 @@ along with this program. If not, see + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,16 +99,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/> <title-text><![CDATA[Weiteres:]]></title-text> + - - - - - - - - - @@ -75,6 +110,7 @@ along with this program. If not, see + @@ -84,7 +120,18 @@ along with this program. If not, see + + + + + + + + + + + diff --git a/core b/core index b2f9b3f..c00f206 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b2f9b3f98dad63c32b07b891f3e19135398090ad +Subproject commit c00f2069057fcaa301bb045f5801e8bc0ff7c658