From: Roland Häder Date: Tue, 18 Nov 2008 23:32:48 +0000 (+0000) Subject: Blog login area fixed, missing classes added X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=commitdiff_plain;h=ce3dd221068ad6dfe9e2e1f1fb01b924608aef15 Blog login area fixed, missing classes added - Missing class WebBlogLoginWelcomeAction added to make the blog working again - Missing config entries added - Ship Simu code parts removed from blog template - Missing command class for Ship Simu added - Minor template fixes --- diff --git a/.gitattributes b/.gitattributes index 0754e3c..72fea3a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -67,6 +67,9 @@ application/blog/init.php -text application/blog/interfaces/.htaccess -text application/blog/loader.php -text application/blog/main/.htaccess -text +application/blog/main/actions/.htaccess -text +application/blog/main/actions/web/.htaccess -text +application/blog/main/actions/web/class_WebBlogLoginWelcomeAction.php -text application/blog/main/class_ -text application/blog/starter.php -text application/blog/templates/.htaccess -text @@ -187,6 +190,7 @@ application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php -te application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php -text application/ship-simu/main/commands/web/goverment/.htaccess -text application/ship-simu/main/commands/web/goverment/class_WebGovermentFailedStartupCommand.php -text +application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php -text application/ship-simu/main/companies/.htaccess -text application/ship-simu/main/companies/class_ShippingCompany.php -text application/ship-simu/main/constructions/.htaccess -text diff --git a/application/blog/config.php b/application/blog/config.php index 7d84d50..10b96ca 100644 --- a/application/blog/config.php +++ b/application/blog/config.php @@ -127,6 +127,9 @@ $cfg->setConfigEntry('login_default_action', "welcome"); // CFG: NEWS-READER-CLASS $cfg->setConfigEntry('news_reader_class', "DefaultNewsReader"); +// CFG: NEWS-READER-LOGIN-AREA-CLASS +$cfg->setConfigEntry('news_reader_login_area_class', "DefaultNewsReader"); + // CFG: NEWS-DOWNLOAD-FILTER $cfg->setConfigEntry('news_download_filter', "NewsDownloadFilter"); diff --git a/application/blog/main/actions/.htaccess b/application/blog/main/actions/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/blog/main/actions/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/blog/main/actions/web/.htaccess b/application/blog/main/actions/web/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/blog/main/actions/web/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/blog/main/actions/web/class_WebBlogLoginWelcomeAction.php b/application/blog/main/actions/web/class_WebBlogLoginWelcomeAction.php new file mode 100644 index 0000000..2350912 --- /dev/null +++ b/application/blog/main/actions/web/class_WebBlogLoginWelcomeAction.php @@ -0,0 +1,78 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebBlogLoginWelcomeAction extends BaseAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public final static function createWebBlogLoginWelcomeAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebBlogLoginWelcomeAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Unfinished method + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Unfinished method + } +} + +// [EOF] +?> diff --git a/application/blog/templates/de/code/login_main.ctp b/application/blog/templates/de/code/login_main.ctp index e9e25d9..abeacc7 100644 --- a/application/blog/templates/de/code/login_main.ctp +++ b/application/blog/templates/de/code/login_main.ctp @@ -22,46 +22,6 @@ if ($blockInstance->ifIncludeRegistrationStamp()) { // Flush the content out to a template variable $blockInstance->flushContent(); -////////////////////////////////////// -// Assign the shipping company data // -////////////////////////////////////// - -// Get a new instance for personal data -$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data')); - -// Set the data source instance -$blockInstance->prefetchValueInstance('company', 'user'); - -// Assign the company name -if ($blockInstance->getValueInstance()->ifUserIsFounder()) { - // User is the founder of the company - $blockInstance->assignMessageField('company_status', "user_is_company_founder"); - $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview"); - $blockInstance->assignMessageField('company_link_text', "link_text_company_overview"); - $blockInstance->assignMessageField('company_link_title', "link_title_company_overview"); -} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { - // User owns the company - $blockInstance->assignMessageField('company_status', "user_is_company_owner"); - $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview"); - $blockInstance->assignMessageField('company_link_text', "link_text_company_overview"); - $blockInstance->assignMessageField('company_link_title', "link_title_company_overview"); -} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) { - // User is employed in company - $blockInstance->assignMessageField('company_status', "user_is_employed_in_company"); - $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview"); - $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview"); - $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview"); -} else { - // No company participation! - $blockInstance->assignMessageField('company_status', "user_not_assigned_company"); - $blockInstance->assignLinkFieldWithAction('company_link' , "company"); - $blockInstance->assignMessageField('company_link_text', "link_text_company"); - $blockInstance->assignMessageField('company_link_title', "link_title_company"); -} - -// Flush the content out to a template variable -$blockInstance->flushContent(); - // Get helper instance $helper = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout_action_link', 'index.php?app={?app_short_name?}&page=login_area')); diff --git a/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php b/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php new file mode 100644 index 0000000..18a3bc0 --- /dev/null +++ b/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php @@ -0,0 +1,92 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuGovermentStartupCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public final static function createWebShipsimuGovermentStartupCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebShipsimuGovermentStartupCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + $this->partialStub("Unfinished method."); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Maybe we need some filters here? + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Check if goverment can pay startup help + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter')); + + // Verify password + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + + // Verify CAPTCHA code + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp index 9f44f71..2d3e27c 100644 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp +++ b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp @@ -15,7 +15,7 @@ $helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die $helperInstance->addFormNote('surname', "Vorname: ".$helperInstance->getValueField('surname').""); $helperInstance->addFormNote('family', "Nachname: ".$helperInstance->getValueField('family').""); $helperInstance->addFormNote('email', "Email-Adresse: ".$helperInstance->getValueField('email').""); -$helperInstance->addFormNote('birthday', "Geburtstag: ".$helperInstance->getValueField('birth_day').".".$helperInstance->getValueField('birth_month').".".$helperInstance->getValueField('birth_year').""); +$helperInstance->addFormNote('birthday', "Geburtstag: ".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year').""); // Add link placeholder for profile page $helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile_link?}");