]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/filter/validator/class_EmailValidatorFilter.php
Password validator added, if emails mismatch the request will be rejected
[shipsimu.git] / inc / classes / main / filter / validator / class_EmailValidatorFilter.php
index 37e207d7b373a8abe83f317594f04fec419af862..6c4f74bb689497db9e0366c015ba6dbde4972c04 100644 (file)
@@ -1,9 +1,9 @@
 <?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
@@ -110,6 +110,15 @@ class EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
                                // 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