Heacy rewrite/cleanup:
[mailer.git] / inc / modules / guest / what-sponsor_reg.php
index 5a7f76999b8b09318330e9691d3378e954979837..0750e187559d13e8b4868ad77522d24801c137e3 100644 (file)
@@ -182,7 +182,7 @@ if (isFormSent()) {
                                array_push($formErrors, '{--SPONSOR_PASSWORD2_EMPTY--}');
                        }
                }
-       } elseif (strlen(postRequestElement('password1')) < getPassLen()) {
+       } elseif (strlen(postRequestElement('password1')) < getMinPasswordLength()) {
                // Password is to short!
                array_push($formErrors, '{--SPONSOR_PASSWORD_TOO_SHORT--}');
        }
@@ -194,10 +194,10 @@ if (isFormSent()) {
        } // END - if
 
        // If there is something wrong/missing stop registration
-       if (count($formErrors) > 0) unsetPostRequestElement('ok');
+       if (isFilledArray($formErrors)) unsetPostRequestElement('ok');
 } // END - if
 
-if ((isFormSent()) && (count($formErrors) == 0)) {
+if ((isFormSent()) && (!isFilledArray($formErrors))) {
        // Generate message array
        $messageArray = array(
                'failed' => '{--SPONSOR_REGISTRATION_FAILED--}',
@@ -263,7 +263,7 @@ ORDER BY
                } // END - foreach
 
                // Check for invalid entries
-               if (count($formErrors) > 0) {
+               if (isFilledArray($formErrors)) {
                        // Some found... :-(
                        foreach (array('company','position','tax_ident','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url') as $entry) {
                                $content[$entry]    = postRequestElement($entry);
@@ -278,7 +278,7 @@ ORDER BY
                        $OUT = '';
 
                        // Errors found?
-                       if (count($formErrors) > 0) {
+                       if (isFilledArray($formErrors)) {
                                $OUT = displayMessage('{--SPONSOR_REGISTER_SOMETHING_MISSING--}', TRUE);
                                $OUT .= '<ol>';
                                foreach ($formErrors as $error) {