Added isGuest() isConfirmed() to BaseUser for wrapping this type of check into
[core.git] / inc / classes / main / filter / verifier / class_UserStatusVerifierFilter.php
index e4f0ef7f7df5caa09df052d3ebaae46275a66b72..94b62a23cd400b6ccf8764e27a9ae3747fd5159e 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A filter for checking if user status is GUEST or CONFIRMED.
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.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
@@ -57,9 +57,9 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = Registry::getRegistry()->getInstance('user');
 
                // Is the user account confirmed?
-               if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_guest')) && ($requestInstance->getRequestElement('action') != $this->getConfigInstance()->getConfigEntry('action_status_problem'))) {
+               if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != $this->getConfigInstance()->getConfigEntry('action_status_problem'))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->requestIsValid(FALSE);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('login_user_status');