FRED™
3.0
FRED™: Framework for Rapid and Easy Development
GeoIp.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Rsi\Fred\User\Authenticator
;
4
5
class
GeoIp
extends
\Rsi\Fred\User\Authenticator{
6
7
public
$countries
= [];
//!< Allowed country codes (ISO 3166-1 alpha-2).
8
9
public
function
check
(){
10
$info = $this->
component
(
'services'
)->geoIp($this->
component
(
'security'
)->remoteAddr);
11
return
$info && in_array($info[
'countryCode'
],array_map(
'strtoupper'
,$this->countries));
12
}
13
14
}
Rsi\Fred\User\Authenticator\GeoIp\$countries
$countries
Allowed country codes (ISO 3166-1 alpha-2).
Definition:
GeoIp.php:7
Rsi\Fred\User\Authenticator\GeoIp\check
check()
Definition:
GeoIp.php:9
Rsi\Fred\User\Authenticator\GeoIp
Definition:
GeoIp.php:5
Rsi\Fred\User\Authenticator
Definition:
GeoIp.php:3
Rsi\Fred\Component\component
component($name)
Get a component (local or default).
Definition:
Component.php:80
src
Rsi
Fred
User
Authenticator
GeoIp.php
Generated on Sun Aug 2 2020 19:43:58 for FRED™ by
1.8.13