]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-register.php
More queries now depends on UNIX_TIMESTAMP() not on time(), more fixes for not instal...
[mailer.git] / inc / modules / guest / what-register.php
index f06e9ee66f391b88623d09c432b36ba1501b20c7..ac63b929b2d49c5435e4e524829d1c94107b4bdd 100644 (file)
@@ -145,9 +145,8 @@ if (isset($_POST['ok']))
        }
 
        // Check his IP number
-       $to = bigintval(time() - $_CONFIG['ip_timeout']);
-       $result = SQL_QUERY_ESC("SELECT joined, last_update FROM "._MYSQL_PREFIX."_user_data WHERE REMOTE_ADDR='%s' AND (joined > %s OR last_update > %s) LIMIT 1",
-        array(getenv('REMOTE_ADDR'), $to, $to), __FILE__, __LINE__);
+       $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__);
        if ((SQL_NUMROWS($result) == 1) && (!IS_ADMIN()))
        {
                // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
@@ -159,8 +158,7 @@ if (isset($_POST['ok']))
        // Test the refid (because some strange hackers... :-P)
        $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
         array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 0)
-       {
+       if (SQL_NUMROWS($result) == 0) {
                // Not found so we set your refid!
                $_POST['refid'] = $_CONFIG['def_refid'];
                set_session("refid", $_CONFIG['def_refid']);