<?php
/**
* A concrete filter for validating the email address. This filter may intercept
- * the filter chain if no email address is given or if the supplied username has
- * an invalid form. It could also intercept the filter chain if the email
- * address is already used by some one if configuration requires this.
+ * the filter chain if no email address is given or if the supplied email has an
+ * invalid form. It could also intercept the filter chain if the email address
+ * is already used by some one if configuration requires this.
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
* 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 EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class EmailValidatorFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
$this->setObjectDescription("A filter for Email validation");
// Create unique ID number
- $this->createUniqueID();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
+ $this->generateUniqueId();
}
/**
// Add a message to the response
$responseInstance->addFatalMessage('email_taken');
+ // Abort here
+ return false;
+ } elseif ($email1 != $email2) {
+ // Emails didn't match
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('emails_mismatch');
+
// Abort here
return false;
} // END - elseif
$userInstance->setEmailAddress($email);
} else {
// If this instance is created then the username *does* exist
- $userInstance = User::createUserByEmail($email);
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), "createUserByEmail"), array($email));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);