FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Subnet.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Subnet extends \Rsi\Fred\User\Authenticator{
6 
7  public $subnets = []; //!< Allowed subnets (CIDR notation).
8 
9  protected function init(){
10  parent::init();
11  $this->invalidate(); //re-check every time
12  }
13 
14  public function check(){
15  return \Rsi\Http::inSubnet($this->subnets,$this->component('security')->remoteAddr);
16  }
17 
18 }
$subnets
Allowed subnets (CIDR notation).
Definition: Subnet.php:7
component($name)
Get a component (local or default).
Definition: Component.php:80