Cache will be rebuild after refback is installed
[mailer.git] / beg.php
diff --git a/beg.php b/beg.php
index f4a0bd13f3aba0935318e6d761095b764f60036b..d212731055f79af25aff299f74f375cb66d01844 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -117,7 +117,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 
                        // Check for last entry for userid w/o IP number
                        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_timeout'].") OR (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_uid_timeout'].") AND userid=%s)) AND remote_ip='%s' LIMIT 1",
-                        array($uid, getenv('REMOTE_ADDR')), __FILE__, __LINE__);
+                        array($uid, GET_REMOTE_ADDR()), __FILE__, __LINE__);
                        if ((SQL_NUMROWS($result) == 0) && ($points > 0) && (!$login)) {
                                // Free memory
                                SQL_FREERESULT($result);
@@ -126,8 +126,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                        // Remember remote address, userid and timestamp for next click
                                        // but only when there is no admin begging.
                                        // Admins shall be able to test it!
-                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_beg_ips (userid, remote_ip, timeout) VALUES('%s', '%s', UNIX_TIMESTAMP())",
-                                        array($uid, getenv('REMOTE_ADDR')), __FILE__, __LINE__);
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_beg_ips (userid, remote_ip, timeout) VALUES('%s','%s', UNIX_TIMESTAMP())",
+                                        array($uid, GET_REMOTE_ADDR()), __FILE__, __LINE__);
                                }
 
                                // Set mode depending on how many mails the member has to confirm