application/ship-simu/templates/de/code/block_company_data.ctp -text
application/ship-simu/templates/de/code/block_persona_data.ctp -text
application/ship-simu/templates/de/code/captch_graphic_code.ctp -text
+application/ship-simu/templates/de/code/confirm_link.ctp -text
application/ship-simu/templates/de/code/footer.ctp -text
application/ship-simu/templates/de/code/header.ctp -text
application/ship-simu/templates/de/code/home.ctp -text
inc/classes/main/commands/image/.htaccess -text
inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php -text
inc/classes/main/commands/web/.htaccess -text
+inc/classes/main/commands/web/class_WebConfirmCommand.php -text
inc/classes/main/commands/web/class_WebDoFormCommand.php -text
inc/classes/main/commands/web/class_WebHomeCommand.php -text
inc/classes/main/commands/web/class_WebLoginAreaCommand.php -text
inc/classes/main/controller/login/.htaccess -text
inc/classes/main/controller/login/class_WebLoginAreaController.php -text
inc/classes/main/controller/web/.htaccess -text
+inc/classes/main/controller/web/class_WebConfirmController.php -text
inc/classes/main/controller/web/class_WebDefaultController.php -text
inc/classes/main/controller/web/class_WebDefaultNewsController.php -text
inc/classes/main/controller/web/class_WebLoginController.php -text
inc/classes/main/filter/null/.htaccess -text
inc/classes/main/filter/null/class_NullFilter.php -text
inc/classes/main/filter/update/.htaccess -text
+inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php -text
inc/classes/main/filter/update/class_UserUpdateFilter.php -text
inc/classes/main/filter/validator/.htaccess -text
+inc/classes/main/filter/validator/class_ConfirmCodeValidatorFilter.php -text
inc/classes/main/filter/validator/class_EmailValidatorFilter.php -text
inc/classes/main/filter/validator/class_PasswordValidatorFilter.php -text
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php -text
inc/classes/main/filter/verifier/.htaccess -text
inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php -text
inc/classes/main/filter/verifier/class_EmailValidatorFilter.php -text
inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php -text
inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php -text
// CFG: USER-UNCONFIRMED-EMAIL-MISSING-URL
$cfg->setConfigEntry('user_unconfirmed_email_missing_url', "index.php?app=ship-simu&page=status&status=unconfirmed_email_missing");
+// CFG: CONFIRM-CODE-INVALID-URL
+$cfg->setConfigEntry('confirm_code_invalid_url', "index.php?app=ship-simu&page=status&status=confirm_code_invalid");
+
// CFG: LOGIN-DEFAULT-ACTION
$cfg->setConfigEntry('login_default_action', "welcome");
// CFG: USER-UPDATE-CLASS
$cfg->setConfigEntry('user_update_class', "UserUpdateFilter");
+// CFG: USER-STATUS-CONFIRMED-CLASS
+$cfg->setConfigEntry('user_status_confirmed_class', "UserStatusConfimedUpdateFilter");
+
// CFG: CAPTCHA-ENCRYPT-VALIDATOR-CLASS
$cfg->setConfigEntry('captcha_encrypt_validator_class', "CaptchaEncryptFilter");
// CFG: CAPTCHA-REGISTER-VERIFIER-CLASS
$cfg->setConfigEntry('captcha_register_verifier_class', "GraphicalCodeCaptchaVerifierFilter");
+// CFG: CONFIRM-CODE-VALIDATOR-CLASS
+$cfg->setConfigEntry('confirm_code_verifier_class', "ConfirmCodeVerifierFilter");
+
// CFG: NEWS-HOME-LIMIT
$cfg->setConfigEntry('news_home_limit', 10);
// CFG: LOGIN-ENABLED
$cfg->setConfigEntry('login_enabled', "Y");
+// CFG: CONFIRM-EMAIL-ENABLED
+$cfg->setConfigEntry('confirm_email_enabled', "Y");
+
// CFG: LOGIN-DISABLED-REASON
$cfg->setConfigEntry('login_disabled_reason', "Loginbereich befindet sich noch im Aufbau.");
* @return void
*/
public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
- // Default is user account!
+ // Default is unconfirmed!
$configEntry = 'user_status_unconfirmed';
+ // Is the confirmation process entirely disabled?
+ if ($this->getConfigInstance()->readConfig('confirm_email_enabled') === "N") {
+ // No confirmation of email needed
+ $configEntry = 'user_status_confirmed';
+ } // END - if
+
// Add a lot elements to the dataset criteria
foreach ($this->criteriaElements as $alias=>$element) {
// Do we have an alias?
$criteriaInstance->setUniqueKey('username');
// Add account status as configured
- $criteriaInstance->addConfiguredCriteria('user_status', $configEntry);
+ $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry);
// Include registration timestamp
$criteriaInstance->addCriteria('registered', date("Y-m-d H:i:s", time()));
<div class="gamer_name_div">
Spielername: <span class="gamer_name">{?block_username?}</span>
</div>
+<div class="gamer_status_div">
+ Spielerstatus: <span class="gamer_status">{?block_user_status?}</span>
+</div>
<div class="gamer_profile_div">
{?profile_link?}
</div>
--- /dev/null
+<div id="content_header">
+ Bestätigung Deiner Email-Adresse:
+</div>
+
+<div id="content_body">
+ Hallo <span class="data_username">{?username?}</span>! Du hast heute deine
+ Email-Addresse bestätigt, wodurch alle Spielefunktionen entsperrt
+ worden sind. Viel Spass beim Spielen!
+</div>
+
+<div id="content_footer">
+ <a href="$config[base_url]/index.php?app=ship-simu&page=login" title="Direkt zum Login-Formular">Hier geht es direkt zum Login!</a>
+</div>
// Assign fields with template variables
$blockInstance->assignField('username');
+$blockInstance->assignFieldWithFilter('user_status', "user_status_translator");
// Shall we include registration date?
if ($blockInstance->ifIncludeRegistrationStamp()) {
Hier ist nun dein Bestätigungslink. Der alte aus der Anmeldemail ist somit nicht mehr gültig!
-$config[base_url]/index.php?app=ship-simu&page=confirm&confirm={?confirm_hash?}
+$config[base_url]/index.php?app=ship-simu&page=confirm&username={?username?}&confirm={?confirm_hash?}
Solltest du die URL nicht anklicken können, versuche diese in die Adresszeile deines Browsers zu kopieren.
-Alternativ kannst du im Spielebereich oder im Gastbereich unter Bestätigungscode den folgenden Code reinkopieren oder eingeben:
+Alternativ kannst du im Spielebereich unter Bestätigungscode den folgenden Code reinkopieren oder eingeben:
{?confirm_hash?}
-For scripts, except shell scripts, templates and compileable templates see
-COPYING.software.
+For PHP scripts except templates and compileable templates see COPYING.software.
For documents see COPYING.documents.
-The rest of the scripts (shell, templates, code templates) are given away
+The rest of the software (shell scripts, templates, code templates) are given away
"AS IS" and "WITHOUT ANY WARRANTY". So it shall be public domain.
--- /dev/null
+<?php
+/**
+ * A command for the confirmation link handling
+ *
+ * @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 WebConfirmCommand extends BaseCommand implements Commandable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set special description
+ $this->setObjectDescription("Command for confirmation link handling");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Clean up a little
+ $this->removeSystemArray();
+ }
+
+ /**
+ * 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 createWebConfirmCommand (CommandResolver $resolverInstance) {
+ // Get new instance
+ $commandInstance = new WebConfirmCommand();
+
+ // 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
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get the application instance
+ $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+ // Prepare a template instance
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+ // Assign application data with template engine
+ $templateInstance->assignApplicationData($appInstance);
+
+ // Assign base URL
+ $templateInstance->assignConfigVariable('base_url');
+
+ // Load the master template
+ $masterTemplate = $appInstance->getMasterTemplate();
+
+ // Load header template
+ $templateInstance->loadCodeTemplate('header');
+
+ // Compile and assign it with a variable
+ $templateInstance->compileTemplate();
+ $templateInstance->assignTemplateWithVariable('header', 'header');
+
+ // Load footer template
+ $templateInstance->loadCodeTemplate('footer');
+
+ // Compile and assign it with a variable
+ $templateInstance->compileTemplate();
+ $templateInstance->assignTemplateWithVariable('footer', 'footer');
+
+ // Load the home template
+ $templateInstance->loadCodeTemplate('confirm_link');
+
+ // Assign the home template with the master template as a content ... ;)
+ $templateInstance->assignTemplateWithVariable('confirm_link', 'content');
+
+ // Load the master template
+ $templateInstance->loadCodeTemplate($masterTemplate);
+
+ // Set title
+ $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_confirm_link_title'));
+
+ // Get user instance
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Set username
+ $templateInstance->assignVariable('username', $userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USERNAME));
+
+ // ... and all variables. This should be merged together in a pattern
+ // to make things easier. A cache mechanism should be added between
+ // these two calls to cache compiled templates.
+ $templateInstance->compileVariables();
+
+ // Get the content back from the template engine and put it in the response class
+ $templateInstance->transferToResponse($responseInstance);
+ }
+
+ /**
+ * 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
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Empty for now
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * Controller for confirmation link
+ *
+ * @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 WebConfirmController extends BaseController implements Controller {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Controller for confirmation link handling");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $resolverInstance An instance of a command resolver class
+ * @return $controllerInstance A prepared instance of this class
+ * @todo Add some filters to this controller
+ */
+ public final static function createWebConfirmController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new WebConfirmController();
+
+ // Set the command resolver
+ $controllerInstance->setResolverInstance($resolverInstance);
+
+ // Add filters for handling confirmation code and username
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_class'));
+
+ // Return the prepared instance
+ return $controllerInstance;
+ }
+
+ /**
+ * Handles the given request and response
+ *
+ * @param $requestInstance An instance of a request class
+ * @param $responseInstance An instance of a response class
+ * @return void
+ */
+ public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get the command instance from the resolver by sending a request instance to the resolver
+ $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+ // Run the pre filters
+ $this->executePreFilters($requestInstance, $responseInstance);
+
+ // This request was valid! :-D
+ $requestInstance->requestIsValid();
+
+ // Execute the command
+ $commandInstance->execute($requestInstance, $responseInstance);
+
+ // Run the pre filters
+ $this->executePostFilters($requestInstance, $responseInstance);
+
+ // Flush the response out
+ $responseInstance->flushBuffer();
+ }
+}
+
+// [EOF]
+?>
// Set the command resolver
$controllerInstance->setResolverInstance($resolverInstance);
-
// Return the prepared instance
return $controllerInstance;
}
const DB_COLUMN_USERNAME = "username";
const DB_COLUMN_EMAIL = "email";
const DB_COLUMN_CONFIRM_HASH = "confirm_hash";
+ const DB_COLUMN_USER_STATUS = "user_status";
// Constants for database table names
const DB_TABLE_USER = "user";
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
--- /dev/null
+<?php
+/**
+ * A filter for updating the user account status to confirmed
+ *
+ * @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 UserStatusConfimedUpdateFilter extends BaseFrameworkSystem implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("User status 'confirmed' update filter");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createUserStatusConfimedUpdateFilter () {
+ // Get a new instance
+ $filterInstance = new UserStatusConfimedUpdateFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter 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
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Get "confirmed" status from config
+ $confirmed = $this->getConfigInstance()->readConfig('user_status_confirmed');
+
+ // Update the user status to "confirmed" here
+ $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $confirmed);
+
+ // Wipe out the confirm hash for extra security
+ $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, "");
+
+ // Write all updates to the database
+ $userInstance->flushPendingUpdates();
+ }
+}
+
+// [EOF]
+?>
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
--- /dev/null
+<?php
+/**
+ * A filter for checking if the the supplied confirmation code is valid
+ *
+ * @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 ConfirmCodeValidatorFilter extends BaseFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for ConfirmCode validation");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createConfirmCodeValidatorFilter () {
+ // Get a new instance
+ $filterInstance = new ConfirmCodeValidatorFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter 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
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get confirmation code from request
+ $confirmCode = $requestInstance->getRequestElement('confirm');
+
+ // Is this code set?
+ if (is_null($confirmCode)) {
+ // Is not in request
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('confirm_code_unset');
+
+ // Abort here
+ return false;
+ } elseif (empty($confirmCode)) {
+ // Email is empty
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('confirm_code_empty');
+
+ // Abort here
+ return false;
+ }
+ }
+}
+
+// [EOF]
+?>
if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) {
// This username is still available
$alreadyTaken = false;
- }
+ } // END - if
// Return the result
return $alreadyTaken;
--- /dev/null
+<?php
+/**
+ * A filter for checking if the the supplied confirmation code is valid
+ *
+ * @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 ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for confirmation code verification");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createConfirmCodeVerifierFilter () {
+ // Get a new instance
+ $filterInstance = new ConfirmCodeVerifierFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter 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
+ * @throws NullPointerException If the user instance from registry is null
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get confirmation code from request
+ $confirmCode = $requestInstance->getRequestElement('confirm');
+
+ // Is this code set?
+ if (is_null($confirmCode)) {
+ // Is not in request
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('confirm_code_unset');
+
+ // Abort here
+ return false;
+ } elseif (empty($confirmCode)) {
+ // Email is empty
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('confirm_code_empty');
+
+ // Abort here
+ return false;
+ }
+
+ // Get a user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
+ // Is the instance there?
+ if (is_null($userInstance)) {
+ // Throw an exception here
+ throw new NullPointerException ($this, self::EXCEPTION_IS_NULL_POINTER);
+ } // END - if
+
+ // Get the confirm code from user for comparison
+ $userCode = $userInstance->getField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH);
+
+ // Do we have the same code or different?
+ if ($userCode != $confirmCode) {
+ // Email is empty
+ $requestInstance->requestIsValid(false);
+
+ // Redirect to error page
+ $responseInstance->redirectToConfiguredUrl('confirm_code_invalid_url');
+
+ // Stop processing here
+ exit;
+ } // END - if
+ }
+}
+
+// [EOF]
+?>
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
$userInstance = Registry::getRegistry()->getInstance('user');
// Is the user account confirmed?
- if (($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_confirmed')) && ($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_guest'))) {
+ if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_guest'))) {
// Request is invalid!
$requestInstance->requestIsValid(false);
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
} // END - if
// Is the user account confirmed?
- if ($userInstance->getField('user_status') != $this->getConfigInstance()->readConfig('user_status_unconfirmed')) {
+ if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_unconfirmed')) {
// Request is invalid!
$requestInstance->requestIsValid(false);
$fieldValue = $this->getValueField($fieldName);
// Now filter it through the value through the filter method
- $filteredValue = call_user_func_array(array($this, "doFilter" . ucfirst($filterMethod)), array($fieldValue));
+ $filteredValue = call_user_func_array(array($this, "doFilter" . $this->convertToClassName($filterMethod)), array($fieldValue));
// Assign it with a template variable
$this->getTemplateInstance()->assignVariable("block_" . $fieldName, $filteredValue);
$this->getTemplateInstance()->assignVariable($linkField . '_action', $actionValue);
}
+ /**
+ * "Filter" method for translating the raw user status into something human-readable
+ *
+ * @param $userStatus Raw user status from database layer
+ * @return $translated Translated user status
+ */
+ protected function doFilterUserStatusTranslator ($userStatus) {
+ // Generate message id
+ $messageId = 'user_status_' . strtolower($userStatus);
+
+ // Get that message
+ $translated = $this->getLanguageInstance()->getMessage($messageId);
+
+ // Return it
+ return $translated;
+ }
+
/**
* Flush the content out,e g. to a template variable
*
* @return $isUnconfirmed Wether the user account is unconfirmed
*/
public function ifUserAccountUnconfirmed () {
- $isUnconfirmed = ($this->getValueField('user_status') === $this->getConfigInstance()->readConfig('user_status_unconfirmed'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_unconfirmed'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Wether the user account is locked
*/
public function ifUserAccountLocked () {
- $isUnconfirmed = ($this->getValueField('user_status') === $this->getConfigInstance()->readConfig('user_status_locked'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_locked'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Wether the user account is a guest
*/
public function ifUserAccountGuest () {
- $isUnconfirmed = ($this->getValueField('user_status') === $this->getConfigInstance()->readConfig('user_status_guest'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_guest'));
return $isUnconfirmed;
}
}
return $tplInstance;
}
+ /**
+ * Getter for current main node
+ *
+ * @return $currMainNode Current main node
+ */
+ public final function getCurrMainNode () {
+ return $this->currMainNode;
+ }
+
+ /**
+ * Getter for main node array
+ *
+ * @return $mainNodes Array with valid main node names
+ */
+ public final function getMainNodes () {
+ return $this->mainNodes;
+ }
+
+ /**
+ * Getter for sub node array
+ *
+ * @return $subNodes Array with valid sub node names
+ */
+ public final function getSubNodes () {
+ return $this->subNodes;
+ }
+
/**
* Handles the start element of an XML resource
*