/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to classes/download.php

  • Committer: Suren A. Chilingaryan
  • Date: 2020-03-02 13:19:51 UTC
  • Revision ID: csa@suren.me-20200302131951-q03z0ugr5p1ngj1i
Handle HAProxy headers for detecting IPs in DOWNLOADManager

Show diffs side-by-side

added added

removed removed

Lines of Context:
506
506
  }
507
507
 
508
508
  function GetIp() {
509
 
    if(getenv("HTTP_CLIENT_IP"))   $ip = getenv("HTTP_CLIENT_IP");
 
509
    if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
 
510
    else if(getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
510
511
    else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");   
511
512
    else $ip = "Unknown IP";
512
513
    if($ip == "::1") $ip = "127.0.0.1";