application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php -text
+application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php -text
application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php -text
application/ship-simu/main/bank/.htaccess -text
// CFG: CAPTCHA-REFILL-VERFIER-FILTER
$cfg->setConfigEntry('captcha_refill_verifier_filter', "GraphicalCodeCaptchaVerifierFilter");
+// CFG: CAPTCHA-PROFILE-VERFIER-FILTER
+$cfg->setConfigEntry('captcha_profile_verifier_filter', "GraphicalCodeCaptchaVerifierFilter");
+
// CFG: CONFIRM-CODE-VERIFIER-FILTER
$cfg->setConfigEntry('confirm_code_verifier_filter', "ConfirmCodeVerifierFilter");
// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA
$cfg->setConfigEntry('shipsimu_guest_login_captcha', "GraphicalCodeCaptcha");
+// CFG: SHIPSIMU-PROFILE-CAPTCHA
+$cfg->setConfigEntry('shipsimu_profile_captcha', "GraphicalCodeCaptcha");
+
// CFG: REFILL-FORM-CAPTCHA
$cfg->setConfigEntry('refill_form_captcha', "GraphicalCodeCaptcha");
// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA-SECURED
$cfg->setConfigEntry('shipsimu_guest_login_captcha_secured', "Y");
+// CFG: SHIPSIMU-PROFILE-CAPTCHA-SECURED
+$cfg->setConfigEntry('shipsimu_profile_captcha_secured', "Y");
+
// CFG: REFILL-FORM-CAPTCHA-SECURED
$cfg->setConfigEntry('refill_form_captcha_secured', "Y");
* @todo Add some filters here
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
- // Unfinished method
+ // Check for user status by default
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
}
}
* @return void
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Check for user status by default
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
}
}
--- /dev/null
+<?php
+/**
+ * An action for profile (editing) page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginProfileAction 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 createWebShipSimuLoginProfileAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new WebShipSimuLoginProfileAction();
+
+ // 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) {
+ // Check for user status by default
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ }
+}
+
+// [EOF]
+?>
// Account password validation
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+ // Validate CAPTCHA input
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter'));
+
// Email changed
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter'));
// Add main form group
$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!");
+// Add group for personal data
+$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Kursusteilnahme nötig sind:");
+
+// Display email, surname and family name
+$helperInstance->addFormNote('name', "Dein Name: <span class=\"persona_data\">".$helperInstance->getValueField('surname')." ".$helperInstance->getValueField('family')."</span>");
+$helperInstance->addFormNote('email', "Email-Adresse: <span class=\"persona_data\">".$helperInstance->getValueField('email')."</span>");
+
+// Add link placeholder for profile page
+$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile_link?}");
+
// Flush the finished form
$helperInstance->flushContent();
+// Get link helper for profile link
+$linkInstance = WebLinkHelper::createWebLinkHelper($this, 'shipsimu_profile_link', 'index.php?app={?app_short_name?}&page=login_area');
+
+// Add action
+$linkInstance->addActionLinkById('profile', 'goto_profile_link');
+
+// Flush the finished form
+$linkInstance->flushContent();
+
?>
<div id="goverment_frame">
<div id="goverment_header">
$helperInstance->addInputPasswordField('pass2');
// Display current email
-$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: <span id=\"displayed_field\">".$helperInstance->getValueField('email')."</span>");
+$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: <span class=\"persona_data\">".$helperInstance->getValueField('email')."</span>");
// Only for changing email address
if ($helperInstance->ifEmailChangeAllowed()) {
if ($helperInstance->ifEmailMustBeUnique()) {
$helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein.");
- } // END - Unique email addresses
+ } // END - if
if ($helperInstance->ifEmailChangeRequireConfirmation()) {
$helperInstance->addFormNote('confirm_link', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an.");
- } // END - Change requires confirmation
-} // END - email change allowed
+ } // END - if
+} // END - if
// Add form group for user profile
$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern.");
$helperInstance->addInputTextFieldWithDefault('street');
$helperInstance->addFieldText('city', "Wohnort:");
$helperInstance->addInputTextFieldWithDefault('city');
-} // END - Persona data
+} // END - if
-// Add su group for zip code
+// Add sub group for zip code
$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?");
$helperInstance->addFieldText('zip', "Postleitzahl:");
$helperInstance->addInputTextFieldWithDefault('zip');
} // END - if
if (!$helperInstance->ifRegisterRequiresEmailVerification()) {
- $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst.");
-} // END - Extra note
+ $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per Email sind im Loginbereich verfeinerbar, welche du genau haben willst.");
+} // END - if
// Rules already accepted?
if ($helperInstance->ifRulesHaveChanged()) {
$helperInstance->addInputHiddenField('rules', "1");
}
+// CAPTCHA enabled?
+if ($helperInstance->ifFormSecuredWithCaptcha()) {
+ $helperInstance->addFormGroup('captcha_user', "Unser Benuzter-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst.");
+ $helperInstance->addCaptcha();
+} // END - if
+
// Ask again for current account password
$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein.");
$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:");
$helperInstance->addInputPasswordField('pass_old');
-// Abschliessender Hinweis und Abschluss des Formulars
+// Final notices
$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
$helperInstance->addInputResetButton("Alles nochmal eingeben");
$helperInstance->addInputSubmitButton("Accountdaten aktualisieren");
$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz".");
+
+// Flush finished form
$helperInstance->flushContent();
?>
<div id="content_header">
return false;
} // END - if
+ // Are email and confirmation empty?
+ if ((empty($email1)) && (empty($email2))) {
+ // No email change required!
+ return true;
+ } // END - if
+
// Now, get a user instance for comparison
$userInstance = Registry::getRegistry()->getInstance('user');
return false;
} // END - if
+ // Are password and confirmation empty?
+ if ((empty($pass1)) && (empty($pass2))) {
+ // Don't change password here
+ return true;
+ } // END - if
+
// Do both match?
if ($pass1 != $pass2) {
// Request is invalid!
throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
} // END - if
- // Is a group open?
- if ($this->ifGroupOpenedPreviously()) {
- // Then automatically close it here
- $this->addFormGroup();
- } // END - if
-
// Generate the content
$inputContent = sprintf(" <div id=\"form_note_%s\">
%s
$this->addContentToPreviousGroup($linkContent);
}
+ /**
+ * Adds a link to the previously opened group with a text from language system
+ *
+ * @param $linkAction Action (action=xxx) value for the link
+ * @param $languageId Language id string to use
+ * @return void
+ */
+ public function addActionLinkById ($linkAction, $languageId) {
+ // Resolve the language string
+ $languageResolved = $this->getLanguageInstance()->getMessage($languageId);
+
+ // Add the action link
+ $this->addActionLink($linkAction, $languageResolved);
+ }
+
/**
* Adds a default link (no extra parameters) to the content with specified
* language id string.