X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-register.php;h=c856e14dd790119f9e780bffeccddd7ca58978a6;hp=ea30251620eac9afdcd6df92894b141b1195d670;hb=116f17077ae6fa32c7373ccd6aaf94044bb6c276;hpb=81bfbcd72e424060ea1223b49ad92fcfa150f361 diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index ea30251620..c856e14dd7 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -51,7 +51,7 @@ ADD_DESCR('guest', __FILE__); global $DATA; // Initialize variables -$FAILED = false; $SHORT_PASS = false; $cats = 0; $IP_TIMEOUT = false; +$isFailed = false; $SHORT_PASS = false; $cats = 0; $IP_TIMEOUT = false; if (!IS_FORM_SENT()) REQUEST_UNSET_POST('ok'); @@ -96,28 +96,28 @@ if (IS_FORM_SENT()) { // Did he agree to our Terms Of Usage? if (REQUEST_POST('agree') != 'Y') { REQUEST_SET_POST('agree', '!'); - $FAILED = true; + $isFailed = true; } // END - if // Did he enter a valid email address? (we really don't care about // that, he has to click on a confirmation link :P ) - if ((!REQUEST_ISSET_POST(('addy'))) || (!VALIDATE_EMAIL(REQUEST_POST('addy')))) { + if ((!REQUEST_ISSET_POST(('addy'))) || (!isEmailValid(REQUEST_POST('addy')))) { REQUEST_SET_POST('addy', '!'); - $FAILED = true; + $isFailed = true; } // END - if // And what about surname and family's name? if (!REQUEST_ISSET_POST(('surname'))) { REQUEST_SET_POST('surname', '!'); - $FAILED = true; + $isFailed = true; } // END - if if (!REQUEST_ISSET_POST(('family'))) { REQUEST_SET_POST('family', '!'); - $FAILED = true; + $isFailed = true; } // END - if // Check for required fields - if (!$FAILED) $FAILED = REGISTER_CHECK_REQUIRED_FIELDS(REQUEST_POST_ARRAY()); + if ($isFailed === false) $isFailed = REGISTER_CHECK_REQUIRED_FIELDS(REQUEST_POST_ARRAY()); // Did he enter his password twice? if (((!REQUEST_ISSET_POST(('pass1'))) || (!REQUEST_ISSET_POST(('pass2')))) || ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))))) { @@ -128,13 +128,13 @@ if (IS_FORM_SENT()) { if (!REQUEST_ISSET_POST(('pass1'))) { REQUEST_SET_POST('pass1', '!'); } else { REQUEST_SET_POST('pass1', ''); } if (!REQUEST_ISSET_POST(('pass2'))) { REQUEST_SET_POST('pass2', '!'); } else { REQUEST_SET_POST('pass2', ''); } } - $FAILED = true; + $isFailed = true; } // END - if // Is the password long enouth? - if ((strlen(REQUEST_POST('pass1')) < getConfig('pass_len')) && (!$FAILED)) { + if ((strlen(REQUEST_POST('pass1')) < getConfig('pass_len')) && ($isFailed === false)) { $SHORT_PASS = true; - $FAILED = true; + $isFailed = true; } // END - if // No admin? Admins can always register! @@ -146,7 +146,7 @@ if (IS_FORM_SENT()) { if ($cats < getConfig('least_cats')) { // ... nope! - $FAILED = true; + $isFailed = true; } // END - if } // END - if @@ -155,7 +155,7 @@ if (IS_FORM_SENT()) { $CHK = isEmailTaken(REQUEST_POST('addy')); if ($CHK === true) { REQUEST_SET_POST('addy', '?'); - $FAILED = true; + $isFailed = true; } // END - if } // END - if @@ -168,7 +168,7 @@ if (IS_FORM_SENT()) { // Same IP in timeout range and different email address entered... Eat this, faker! ;-) // But admins are allowed to fake their own exchange service. $IP_TIMEOUT = true; - $FAILED = true; + $isFailed = true; } // END - if } // END - if @@ -176,7 +176,7 @@ if (IS_FORM_SENT()) { SQL_FREERESULT($result); } -if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) { +if ((IS_FORM_SENT()) && (($isFailed === false) || (IS_ADMIN()))) { // Prepapre month and day of birth if (strlen(REQUEST_POST('day')) == 1) REQUEST_SET_POST('day' , '0'.REQUEST_POST('day')); if (strlen(REQUEST_POST('month')) == 1) REQUEST_SET_POST('month', '0'.REQUEST_POST('month'));