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
$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');
// 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');
--- /dev/null
+<?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]
+?>
// 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)) {
// 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');
// 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ä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->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();
-} // END - if
+// Flush content and automatically close the form
+$helperInstance->flushContent();
// [EOC]
?>
kannst dir nun den Bestätigungslink erneut aussenden lassen, oder den
Bestätigungscode unten eingeben.
- <div id="resend_box">
- {?resend?}
+ <div id="resend_link_box">
+ {?resend_link?}
+ </div>
+
+ <div id="confirm_code_header">
+ Weitere Möglichkeiten:
</div>
<div id="confirm_code_box">