]> git.mxchange.org Git - shipsimu.git/commitdiff
Missing class/config entries added, execeute() implemented, some rewrites:
authorRoland Häder <roland@mxchange.org>
Sat, 22 Aug 2009 12:46:58 +0000 (12:46 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 22 Aug 2009 12:46:58 +0000 (12:46 +0000)
- Missing menu class for failed login attempt (e.g. expired auth cookie) added
- execute() method (partly) implemented in government commands
- Double quotes to single converted
- Misc minor rewrites

.gitattributes
application/ship-simu/config.php
application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php
application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php
application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php [new file with mode: 0644]
application/ship-simu/main/registration/class_ShipSimuRegistration.php
application/ship-simu/main/wrapper/class_UserGovernmentDatabaseWrapper.php

index bc11e79b7375a93df27dc50ca79f327f4fb08204..97850f8f0f411cc9e384237d842715e8b1b73d68 100644 (file)
@@ -152,6 +152,7 @@ application/ship-simu/main/menu/class_ShipSimu -text
 application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php -text
 application/ship-simu/main/menu/class_ShipSimuHomeMenu.php -text
 application/ship-simu/main/menu/class_ShipSimuLoginAreaMenu.php -text
+application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php -text
 application/ship-simu/main/menu/class_ShipSimuLoginMenu.php -text
 application/ship-simu/main/menu/class_ShipSimuLogoutMenu.php -text
 application/ship-simu/main/menu/class_ShipSimuRegisterMenu.php -text
index 3514596ec478676a722ee4551db31b348b8971cf..363450b24c62e20aca0d0312a4a93a969458e2ac 100644 (file)
@@ -106,6 +106,9 @@ $cfg->setConfigEntry('app_login_url', 'index.php?app={?app_short_name?}&amp;page
 // CFG: LOGIN-FAILED-URL
 $cfg->setConfigEntry('login_failed_url', 'index.php?app={?app_short_name?}&amp;page=login_failed');
 
+// CFG: LOGIN-FAILED-LOGIN-RETRY-ACTION-URL
+$cfg->setConfigEntry('login_failed_login_retry_action_url', 'index.php?app={?app_short_name?}&amp;page=login&amp;note=login_failed');
+
 // CFG: LOGOUT-DONE-URL
 $cfg->setConfigEntry('logout_done_url', 'index.php?app={?app_short_name?}&amp;page=logout_done');
 
@@ -241,6 +244,9 @@ $cfg->setConfigEntry('captcha_register_verifier_filter', 'GraphicalCodeCaptchaVe
 // CFG: CAPTCHA-REFILL-VERFIER-FILTER
 $cfg->setConfigEntry('captcha_refill_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter');
 
+// CFG: CAPTCHA-GOVERNMENT-VERFIER-FILTER
+$cfg->setConfigEntry('captcha_government_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter');
+
 // CFG: CAPTCHA-PROFILE-VERFIER-FILTER
 $cfg->setConfigEntry('captcha_profile_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter');
 
@@ -460,6 +466,9 @@ $cfg->setConfigEntry('login_register_login_form', 'index.php?app={?app_short_nam
 // CFG: HOME-MENU-CLASS
 $cfg->setConfigEntry('home_menu_class', 'ShipSimuHomeMenu');
 
+// CFG: LOGIN-FAILED-MENU-CLASS
+$cfg->setConfigEntry('login_failed_menu_class', 'ShipSimuLoginFailedMenu');
+
 // CFG: STATUS-MENU-CLASS
 $cfg->setConfigEntry('status_menu_class', 'ShipSimuStatusMenu');
 
index 4464074923eff1de1bac4f497790a94378ccf0e8..fd6cb12331287f300b425485ef3943d9321ff666 100644 (file)
@@ -59,7 +59,11 @@ class WebShipsimuGovernmentStartupCommand extends BaseCommand implements Command
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished method.');
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class');
+
+               // Register the startup help
+               $wrapperInstance->registerStartupHelpByRequest($requestInstance);
        }
 
        /**
@@ -84,7 +88,7 @@ class WebShipsimuGovernmentStartupCommand extends BaseCommand implements Command
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
 
                // Verify CAPTCHA code
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_government_verifier_filter'));
        }
 }
 
index a399674deb9ce269d8f5ee254b3bb2bb05fad318..a5ec956022d7527be5b86ff577fb70ddf906f77e 100644 (file)
@@ -57,7 +57,11 @@ class WebShipsimuGovernmentTrainingCommand extends BaseCommand implements Comman
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished method.');
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class');
+
+               // Register the training
+               $wrapperInstance->registerTrainingByRequest($requestInstance);
        }
 
        /**
diff --git a/application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php b/application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php
new file mode 100644 (file)
index 0000000..013dd84
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A LoginFailed menu class for Ship-Simu
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu 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 ShipSimuLoginFailedMenu 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 createShipSimuLoginFailedMenu () {
+               // Get a new instance
+               $menuInstance = new ShipSimuLoginFailedMenu();
+
+               // Return the prepared instance
+               return $menuInstance;
+       }
+}
+
+// [EOF]
+?>
index 31add01b47969e894506115b9ba019fd08da1401..8b5398e8c1a2d69f445287955ef2ef9a01ce8b2c 100644 (file)
@@ -25,7 +25,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
        /**
         * Hashed password
         */
-       private $hashedPassword = "";
+       private $hashedPassword = '';
 
        /**
         * Elements for criteria
@@ -160,7 +160,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
                $configEntry = 'user_status_unconfirmed';
 
                // Is the confirmation process entirely disabled?
-               if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === "N") {
+               if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === 'N') {
                        // No confirmation of email needed
                        $configEntry = 'user_status_confirmed';
                } // END - if
@@ -177,7 +177,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
                        }
 
                        // Is this a guest account?
-                       if ((($element == "username") || ($alias == "username")) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) {
+                       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
@@ -190,7 +190,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
                $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry);
 
                // Include registration timestamp
-               $criteriaInstance->addCriteria("registered", date("Y-m-d H:i:s", time()));
+               $criteriaInstance->addCriteria('registered', date('Y-m-d H:i:s', time()));
        }
 }
 
index 2bf10350ec2d93c55af073215b66e4a1d36b36ff..428b04e5dd8d2a454ad9d2a094d125b7f83d0e53 100644 (file)
@@ -54,6 +54,16 @@ class UserGovernmentDatabaseWrapper extends BaseDatabaseWrapper {
                // Return the instance
                return $wrapperInstance;
        }
+
+       /**
+        * Registers the given startup help request with the government
+        *
+        * @param       $requestInstance        A Requestable instance
+        * @return      void
+        */
+       public function registerStartupHelpByRequest (Requestable $requestInstance) {
+               $requestInstance->debugInstance();
+       }
 }
 
 // [EOF]