} // 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')) {
} // 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;
}
// @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
array($userid), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == '0') {
+ if (SQL_HASZERONUMS($result)) {
// Add only when the line was not found (maybe some more secure?)
$locked = 'points';