Changeset 702


Ignore:
Timestamp:
Oct 11, 2014, 12:02:15 PM (10 years ago)
Author:
chronos
Message:
  • Upraveno: Obecnější test zda je adresa internetová. Momentálně nepoužito.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r698 r702  
    356356function IsInternetAddr()
    357357{
     358        global $Config;
     359
     360        $Result = true;
    358361  $RemoteAddr = GetRemoteAddress();
    359   $RemoteAddr = explode('.', $RemoteAddr);
    360 //  return(!(($RemoteAddr[0] == 10) and ($RemoteAddr[1] == 145)));
    361   return(!(($RemoteAddr[0] == 10)));
     362  foreach($Config['Web']['IntranetSubnets'] as $Subnet)
     363  {
     364    if(substr($RemoteAddr, 0, strlen($Subnet)) == $Subnet)
     365    {
     366        $Result = false;
     367        break;
     368    }
     369  }
     370  return($Result);
    362371}
    363372
Note: See TracChangeset for help on using the changeset viewer.