]> git.mjollnir.org Git - moodle.git/commitdiff
Use getremoteaddr() in place of getenv("REMOTE_ADDR") and $_SERVER["REMOTE_ADDR"]
authorpaca70 <paca70>
Sat, 4 Sep 2004 11:30:16 +0000 (11:30 +0000)
committerpaca70 <paca70>
Sat, 4 Sep 2004 11:30:16 +0000 (11:30 +0000)
mod/chat/gui_header/chatmsg.php
mod/chat/gui_push_js/chatmsg.php
mod/chat/gui_text/index.php
mod/quiz/attempt.php
mod/wiki/ewiki/ewiki.php
mod/wiki/ewiki/plugins/email_protect.php

index 635188df5aae058ad298e14fde0824faaa5cd3df..3f399b36bfe3423b61a4dc595da9f0d0ba0876c6 100644 (file)
@@ -58,7 +58,7 @@ if ($arsc_my = arsc_getdatafromsid($arsc_sid))
    echo arsc_filter_posting($arsc_a["user"], $arsc_a["sendtime"], $arsc_a["message"], $arsc_room, $arsc_a["flag_ripped"])."\n";
   }
   $arsc_ping = time();
-  $arsc_ip = getenv("REMOTE_ADDR");
+  $arsc_ip = getremoteaddr();
   mysql_query("UPDATE arsc_users SET lastping = '$arsc_ping', ip = '$arsc_ip' WHERE user = '$arsc_user'");
   ?>
     <a name="end"></a>
index 6ec3678be5c769390e91237d3db6d7c03eef831a..91dce60af1b12071600a01dc47e7f988125953b0 100644 (file)
@@ -78,7 +78,7 @@ if ($arsc_my = arsc_getdatafromsid($arsc_sid))
   }
   $arsc_lastid = $arsc_lastid_save;
   $arsc_ping = time();
-  $arsc_ip = getenv("REMOTE_ADDR");
+  $arsc_ip = getremoteaddr();
   mysql_query("UPDATE arsc_users SET lastping = '$arsc_ping', ip = '$arsc_ip' WHERE sid = '$arsc_sid'");
   echo " ";
   flush();
index 85e38341e586df159b59ed5352d2b980d5aa1dc3..d6157713f64ae7f4fbfdb9175ffa922f5bd7ff79 100644 (file)
@@ -107,7 +107,7 @@ if ($arsc_my = arsc_getdatafromsid($arsc_sid))
      $arsc_message = "/msg ".$arsc_my["user"]." ".$arsc_lang["welcome"];
      echo arsc_filter_posting("System", $arsc_sendtime, $arsc_message, $arsc_room, 0);
      $arsc_ping = time();
-     $arsc_ip = getenv("REMOTE_ADDR");
+     $arsc_ip = getremoteaddr();
      mysql_query("UPDATE arsc_users SET lastping = '$arsc_ping', ip = '$arsc_ip' WHERE user = '$arsc_user'");
     ?>
    </body>
index afbbebff5ce3a56091a7e47e2182512bbe626dc1..201c5a05f2bae308a2d95c3b076f923b249396dc 100644 (file)
@@ -71,7 +71,7 @@
     }
 
 /// Check subnet access
-    if ($quiz->subnet and !address_in_subnet($_SERVER['REMOTE_ADDR'], $quiz->subnet)) {
+    if ($quiz->subnet and !address_in_subnet(getremoteaddr(), $quiz->subnet)) {
         error(get_string("subneterror", "quiz"), "view.php?id=$cm->id");
     }
 
index 3645c2eed5890cd36d72791e91900566ea0768a2..8d2dec24ec9dc38cadc70716f5cf31ed3fb83793 100644 (file)
@@ -2887,7 +2887,7 @@ function ewiki_log($msg, $error_type=3) {
    if ((EWIKI_LOGLEVEL >= 0) && ($error_type <= EWIKI_LOGLEVEL)) {
 
       $msg = time() . " - " .
-             $_SERVER["REMOTE_ADDR"] . ":" . $_SERVER["REMOTE_PORT"] . " - " .
+             getremoteaddr() . ":" . $_SERVER["REMOTE_PORT"] . " - " .
              $_SERVER["REQUEST_METHOD"] . " " . $_SERVER["REQUEST_URI"] . " - " .
              strtr($msg, "\n\r\000\377\t\f", "\r\r\r\r\t\f") . "\n";
       error_log($msg, 3, EWIKI_LOGFILE);
@@ -2983,7 +2983,7 @@ function ewiki_array($array, $key=false, $am=1, $ci=EWIKI_CASE_INSENSITIVE) {
 function ewiki_author($defstr="") {
 
    $author = @$GLOBALS["ewiki_author"];
-   ($ip = &$_SERVER["REMOTE_ADDR"]) or ($ip = "127.0.0.0");
+   ($ip = getremoteaddr()) or ($ip = "127.0.0.0");
    ($port = $_SERVER["REMOTE_PORT"]) or ($port = "null");
    $hostname = gethostbyaddr($ip);
    $remote = (($ip != $hostname) ? $hostname . " " : "")
index 9c684b2b1506f7a15c932401657cdd2005b54c9e..55cfc15afe600cee28f7a69c2618f84230968108 100644 (file)
     if (!defined("STR_ROT17")) {
        $i = @$_SERVER["SERVER_SOFTWARE"] .
             @$_SERVER["HTTP_USER_AGENT"] .
-            @$_SERVER["REMOTE_ADDR"];
+            getremoteaddr();
        $i .= 'MxQXF^e-0OKC1\\s{\"?i!8PRoNnljHf65`Eb&A(\':g[D}_|S#~3hG>*9yvdI%<=.urcp/@$ZkqL,TWBw]a;72UzYJ)4mt+ V';
        $f = "";
        while (strlen($i)) {
        switch ($dom = $domains[rand(0, $n_dom)]) {
 
           case "123webhosting.org":
-             $m = strtr(".", "-", $_SERVER["REMOTE_ADDR"])."-".$_SERVER["SERVER_NAME"]."-".time();
+             $m = strtr(".", "-", getremoteaddr())."-".$_SERVER["SERVER_NAME"]."-".time();
              break;
 
           default:
  }
 
 
-?>
\ No newline at end of file
+?>