X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fregister_functions.php;h=5a50b7df0741121bac180c4c2b534d8017e23b75;hp=8dc9420473d6b80a321838fcbef9b7dbc5fe0ad1;hb=07e126c776ca39d4e8d6a751af02b08221e664e2;hpb=324f46c016acb5e50e4e9f739af406b9eaf8b6ac diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 8dc9420473..5a50b7df07 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -223,11 +223,18 @@ function isRegistrationDataComplete () { } // END - if // Do this check only when no admin is logged in - foreach (postRequestParameter('cat') as $id => $answer) { - if ($answer == 'Y') $GLOBALS['register_selected_cats']++; - } // END - foreach + if (is_array(postRequestParameter('cat'))) { + // Only continue with array + foreach (postRequestParameter('cat') as $id => $answer) { + // Is this category choosen? + if ($answer == 'Y') { + $GLOBALS['register_selected_cats']++; + } // END - if + } // END - foreach + } // END - if // Enougth categories selected? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',selected='.$GLOBALS['register_selected_cats'].'/'.getConfig('least_cats')); $isOkay = (($isOkay) && ($GLOBALS['register_selected_cats'] >= getConfig('least_cats'))); if ((postRequestParameter('email') != '!') && (getConfig('check_double_email') == 'Y')) { @@ -239,13 +246,16 @@ function isRegistrationDataComplete () { } // END - if // Check for IP timeout? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay)); if ((!isAdmin()) && (getConfig('ip_timeout') > 0)) { // Check his IP number - $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr() , 'user_data', 'userid', 'REMOTE_ADDR', true, " AND (`joined` > (UNIX_TIMESTAMP() - {?ip_timeout?}) OR `last_update` > (UNIX_TIMESTAMP() - {?ip_timeout?}))") == 1); - $isOkay = false; + $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr() , 'user_data', 'userid', 'REMOTE_ADDR', true, " AND ((UNIX_TIMESTAMP() - `joined`) < {?ip_timeout?} OR (UNIX_TIMESTAMP() - `last_update`) < {?ip_timeout?}) LIMIT 1") == 1); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',timeout='.intval($GLOBALS['registration_ip_timeout'])); + $isOkay = (($isOkay) && (!$GLOBALS['registration_ip_timeout'])); } // END - if // Return result + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay)); return $isOkay; }