// Check his IP number
$result = SQL_QUERY_ESC("SELECT joined, last_update FROM "._MYSQL_PREFIX."_user_data WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
- array(getenv('REMOTE_ADDR'), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__);
+ array(GET_REMOTE_ADDR(), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__);
if ((SQL_NUMROWS($result) == 1) && (!IS_ADMIN()))
{
// Same IP in timeout range and different email address entered... Eat this, faker! ;-)
if (strlen($_POST['day']) == 1) $_POST['day'] = "0".$_POST['day'];
if (strlen($_POST['month']) == 1) $_POST['month'] = "0".$_POST['month'];
+ // Get total users
+ $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+
// Hash = MM-DD-YYYY:IP:USER_AGENT:TIMEMARK
- $hash = generateHash($_POST['month']."-".$_POST['day']."-".$_POST['year'].":".getenv('SERVER_NAME').":".getenv('REMOTE_ADDR').":".getenv('HTTP_USER_AGENT').":".time());
+ $hash = generateHash(sha1($totalUsers.":".$_POST['month']."-".$_POST['day']."-".$_POST['year'].":".getenv('SERVER_NAME').":".GET_REMOTE_ADDR().":".GET_USER_AGENT()."-".time())."/".RAND_NUMBER);
// Add design when extension sql_patches is v0.2.7 or greater
$ADD1 = ""; $ADD2 = "";
bigintval($_POST['max_mails']),
bigintval($_POST['refid']),
$hash,
- getenv('REMOTE_ADDR'),
+ GET_REMOTE_ADDR(),
), __FILE__, __LINE__);
// Get his userid
return;
} // END - if
+ // Is the refback extension there?
+ if (EXT_IS_ACTIVE("refback")) {
+ // Update refback table
+ UPDATE_REFBACK_TABLE($userid);
+ } // END - if
+
// 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__);
// Rewrite gender
$gender = TRANSLATE_GENDER($_POST['gender']);
- // ... rewrite a zero referral ID to the main title
+ // ... rewrite a zero referal ID to the main title
if ($_POST['refid'] == "0") $_POST['refid'] = MAIN_TITLE;
// Prepare data array for the email template