Errors in confirmation/company link fixed
authorRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2009 22:00:26 +0000 (22:00 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2009 22:00:26 +0000 (22:00 +0000)
.gitattributes
application/ship-simu/config.php
application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php [new file with mode: 0644]
application/ship-simu/main/user/class_ShipSimuBaseUser.php
application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp

index 7b79692..b58a7bd 100644 (file)
@@ -148,6 +148,7 @@ application/ship-simu/main/login/helper/.htaccess -text
 application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php -text
 application/ship-simu/main/menu/.htaccess -text
 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_ShipSimuLoginMenu.php -text
index 4ca3bac..f83162e 100644 (file)
@@ -92,7 +92,7 @@ $cfg->setConfigEntry('user_status_guest', 'GUEST');
 $cfg->setConfigEntry('user_status_confirmed', 'CONFIRMED');
 
 // CFG: USER-STATUS-LOCKED
-//$cfg->setConfigEntry('user_status_locked', 'LOCKED');
+$cfg->setConfigEntry('user_status_locked', 'LOCKED');
 
 // CFG: LOGIN-HELPER-CLASS
 $cfg->setConfigEntry('login_helper_class', 'ShipSimuLoginHelper');
@@ -466,6 +466,9 @@ $cfg->setConfigEntry('logout_menu_class', 'ShipSimuLogoutMenu');
 // CFG: REGISTER-MENU-CLASS
 $cfg->setConfigEntry('register_menu_class', 'ShipSimuRegisterMenu');
 
+// CFG: CONFIRM-MENU-CLASS
+$cfg->setConfigEntry('confirm_menu_class', 'ShipSimuConfirmMenu');
+
 // CFG: LOGIN-AREA-MENU-CLASS
 $cfg->setConfigEntry('login_area_menu_class', 'ShipSimuLoginAreaMenu');
 
diff --git a/application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php b/application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php
new file mode 100644 (file)
index 0000000..72d2ddb
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A Confirm 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 ShipSimuConfirmMenu 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 createShipSimuConfirmMenu () {
+               // Get a new instance
+               $menuInstance = new ShipSimuConfirmMenu();
+
+               // Return the prepared instance
+               return $menuInstance;
+       }
+}
+
+// [EOF]
+?>
index e77ba3e..5515d3c 100644 (file)
@@ -70,8 +70,13 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable {
                // Default is that everyone is poor... ;-)
                $hasRequired = false;
 
-               // Get a points instance from registry
-               $pointsInstance = Registry::getRegistry()->getInstance('points');
+               try {
+                       // Get a points instance from registry
+                       $pointsInstance = Registry::getRegistry()->getInstance('points');
+               } catch (NullPointerException $e) {
+                       // Instance not found in registry
+                       // @TODO We should log this exception later
+               }
 
                // Is there an instance?
                if (is_null($pointsInstance)) {
index 5d69da5..df4a8de 100644 (file)
@@ -2,7 +2,7 @@
 // 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('web_form_helper', array($this, "resend"));
+$helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, 'resend_link'));
 
 // Pre-fetch field data with a given registry key
 $helperInstance->prefetchValueInstance('user');
@@ -29,10 +29,13 @@ if ($helperInstance->ifUserAccountUnconfirmed()) {
 // Flush content and automatically close the form
 $helperInstance->flushContent();
 
-if ($helperInstance->ifUserAccountUnconfirmed()) {
-       // Build the form for confirmation
-       $helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, "confirm_code"));
+// Build the form for confirmation
+$helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', 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&auml;tigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen.");
        $helperInstance->addFieldText('code', "Best&auml;tigungscode aus der Mail:");
@@ -42,10 +45,13 @@ if ($helperInstance->ifUserAccountUnconfirmed()) {
        $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!");
        $helperInstance->addInputResetButton("Nochmal eingeben");
        $helperInstance->addInputSubmitButton("Best&auml;tigungscode absenden");
+} else {
+       // Add message
+       $helperInstance->addFormNote('status_not_unconfirmed', "M&ouml;glicherweise hast du einen Best&auml;tigungslink angeklickt, obwohl dein Account bereits freigegeben oder gesperrt ist.");
+}
 
-       // Flush content and automatically close the form
-       $helperInstance->flushContent();
-} // END - if
+// Flush content and automatically close the form
+$helperInstance->flushContent();
 
 // [EOC]
 ?>
@@ -59,8 +65,12 @@ if ($helperInstance->ifUserAccountUnconfirmed()) {
        kannst dir nun den Best&auml;tigungslink erneut aussenden lassen, oder den
        Best&auml;tigungscode unten eingeben.
 
-       <div id="resend_box">
-               {?resend?}
+       <div id="resend_link_box">
+               {?resend_link?}
+       </div>
+
+       <div id="confirm_code_header">
+               Weitere M&ouml;glichkeiten:
        </div>
 
        <div id="confirm_code_box">