X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-register.php;h=51470e2436550892d5945e6392bb6ea1a05f9f56;hb=9e604ce404fe7d2d8dafc259a5fb8cd826aec5e6;hp=5b37fad630685705c04cf23ef8fdbac35bc7bbbc;hpb=11dea7bfe10a659183665aaa0a6cf08b5da66783;p=mailer.git diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 5b37fad630..51470e2436 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -56,30 +56,33 @@ $shortPass = false; $cats = 0; $ipTimedOut = false; +/** + * @TODO Commented out, do we need this ugly code? if (!isFormSent()) REQUEST_UNSET_POST('ok'); -if (!REQUEST_ISSET_POST(('agree'))) REQUEST_SET_POST('agree' , ''); -if (!REQUEST_ISSET_POST(('addy'))) REQUEST_SET_POST('addy' , ''); -if (!REQUEST_ISSET_POST(('surname'))) REQUEST_SET_POST('surname' , ''); -if (!REQUEST_ISSET_POST(('family'))) REQUEST_SET_POST('family' , ''); -if (!REQUEST_ISSET_POST(('pass1'))) REQUEST_SET_POST('pass1' , ''); -if (!REQUEST_ISSET_POST(('pass2'))) REQUEST_SET_POST('pass2' , ''); -if (!REQUEST_ISSET_POST(('day'))) REQUEST_SET_POST('day' , ''); -if (!REQUEST_ISSET_POST(('month'))) REQUEST_SET_POST('month' , ''); -if (!REQUEST_ISSET_POST(('year'))) REQUEST_SET_POST('year' , ''); -if (!REQUEST_ISSET_POST(('max_mails'))) REQUEST_SET_POST('max_mails' , ''); -if (!REQUEST_ISSET_POST(('street_nr'))) REQUEST_SET_POST('street_nr' , ''); +if (!REQUEST_ISSET_POST('agree')) REQUEST_SET_POST('agree' , ''); +if (!REQUEST_ISSET_POST('addy')) REQUEST_SET_POST('addy' , ''); +if (!REQUEST_ISSET_POST('surname')) REQUEST_SET_POST('surname' , ''); +if (!REQUEST_ISSET_POST('family')) REQUEST_SET_POST('family' , ''); +if (!REQUEST_ISSET_POST('pass1')) REQUEST_SET_POST('pass1' , ''); +if (!REQUEST_ISSET_POST('pass2')) REQUEST_SET_POST('pass2' , ''); +if (!REQUEST_ISSET_POST('day')) REQUEST_SET_POST('day' , ''); +if (!REQUEST_ISSET_POST('month')) REQUEST_SET_POST('month' , ''); +if (!REQUEST_ISSET_POST('year')) REQUEST_SET_POST('year' , ''); +if (!REQUEST_ISSET_POST('max_mails')) REQUEST_SET_POST('max_mails' , ''); +if (!REQUEST_ISSET_POST('street_nr')) REQUEST_SET_POST('street_nr' , ''); if (!REQUEST_ISSET_POST('zip')) REQUEST_SET_POST('zip' , ''); -if (!REQUEST_ISSET_POST(('city'))) REQUEST_SET_POST('city' , ''); -if (!REQUEST_ISSET_POST(('cntry'))) REQUEST_SET_POST('cntry' , ''); -if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', '1'); +if (!REQUEST_ISSET_POST('city')) REQUEST_SET_POST('city' , ''); +if (!REQUEST_ISSET_POST('cntry')) REQUEST_SET_POST('cntry' , ''); +if (!REQUEST_ISSET_POST('country_code')) REQUEST_SET_POST('country_code', '1'); +*/ // Default refid is zero REQUEST_SET_POST('refid', 0); if ($GLOBALS['refid'] > 0) { // Test if the refid is valid - $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1", + array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); // Userid found? //* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result).""); @@ -104,32 +107,38 @@ if (isFormSent()) { // 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'))) || (!isEmailValid(REQUEST_POST('addy')))) { + if ((!REQUEST_ISSET_POST('addy')) || (!isEmailValid(REQUEST_POST('addy')))) { REQUEST_SET_POST('addy', '!'); $isFailed = true; } // END - if // And what about surname and family's name? - if (!REQUEST_ISSET_POST(('surname'))) { + if (!REQUEST_ISSET_POST('surname')) { REQUEST_SET_POST('surname', '!'); $isFailed = true; } // END - if - if (!REQUEST_ISSET_POST(('family'))) { + if (!REQUEST_ISSET_POST('family')) { REQUEST_SET_POST('family', '!'); $isFailed = true; } // END - if + // Get temporary array for modification + $postArray = REQUEST_POST_ARRAY(); + // Check for required fields - if ($isFailed === false) $isFailed = REGISTER_CHECK_REQUIRED_FIELDS(REQUEST_POST_ARRAY()); + if ($isFailed === false) $isFailed = ifRequiredRegisterFieldsAreSet($postArray); + + // Set it back in request + REQUEST_SET_POST_ARRAY($postArray); // 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'))))) { - if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) { + if (((!REQUEST_ISSET_POST('pass1')) || (!REQUEST_ISSET_POST('pass2'))) || ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2')))) { + if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2'))) { REQUEST_SET_POST('pass1', '!'); REQUEST_SET_POST('pass2', '!'); } else { - 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', ''); } + 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', ''); } } $isFailed = true; } // END - if @@ -282,16 +291,16 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF // Write his welcome-points $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1", - array(bigintval($userid)), __FILE__, __LINE__); + array(bigintval($userid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Add only when the line was not found (maybe some more secure?) - $locked = "points"; + $locked = 'points'; if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')", - array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__); + array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__); // Update mediadata as well - if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($locked == "points")) { + if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($locked == 'points')) { // Update database MEDIA_UPDATE_ENTRY(array('total_points'), 'add', getConfig('points_register')); } // END - if