}
// Add description as navigation point
-ADD_DESCR("guest", basename(__FILE__));
+ADD_DESCR("guest", __FILE__);
global $_CONFIG, $DATA;
// 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__);
+
+ // Userid found?
+ //* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result)."");
if (SQL_NUMROWS($result) == 0) {
// Not found so we set your refid!
$_POST['refid'] = $_CONFIG['def_refid'];
// First we only check the submitted data then we continue... :)
//
// Did he agree to our Terms Of Usage?
- if ($_POST['agree'] != "Y")
- {
+ if ($_POST['agree'] != "Y") {
$_POST['agree'] = "!";
$FAILED = true;
}
// Did he enter a valid email address? (we really don't care about
// that, he has to click on a confirmation link :P )
- if ((empty($_POST['addy'])) || (!VALIDATE_EMAIL($_POST['addy'])))
- {
+ if ((empty($_POST['addy'])) || (!VALIDATE_EMAIL($_POST['addy']))) {
$_POST['addy'] = "!";
$FAILED = true;
}
// And what about surname and family's name?
- if (empty($_POST['surname']))
- {
+ if (empty($_POST['surname'])) {
$_POST['surname'] = "!";
$FAILED = true;
}
- if (empty($_POST['family_name']))
- {
+ if (empty($_POST['family_name'])) {
$_POST['family_name'] = "!";
$FAILED = true;
}
// 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! ;-)
$totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
// Hash = MM-DD-YYYY:IP:USER_AGENT:TIMEMARK
- $hash = generateHash(sha1($totalUsers.":".$_POST['month']."-".$_POST['day']."-".$_POST['year'].":".getenv('SERVER_NAME').":".getenv('REMOTE_ADDR').":".getenv('HTTP_USER_AGENT')."-".time())."/".RAND_NUMBER);
+ $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
// 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