public function checkAccess()
    {
        if (YII_ENV === 'test') {
            return true;
        }
        $ip = Yii::$app->request->getUserIP();
        foreach ($this->module->allowedIPs as $filter) {
            if ($filter === '*' || $filter === $ip || (($pos = strpos($filter, '*')) !== false && !strncmp($ip, $filter, $pos))) {
                return true;
            }
        }
        echo Yii::t('podium/view', 'Access to Podium installation is denied due to IP address restriction.');
        Yii::warning('Access to Podium installation is denied due to IP address restriction. The requested IP is ' . $ip, __METHOD__);
        return false;
    }
public function checkAccess()
    {
        if (YII_ENV === 'test') {
            return true;
        }
        $ip = Yii::$app->request->getUserIP();
        foreach ($this->module->allowedIPs as $filter) {
            if ($filter === '*' || $filter === $ip || (($pos = strpos($filter, '*')) !== false && !strncmp($ip, $filter, $pos))) {
                return true;
            }
        }
        echo Yii::t('podium/view', 'Access to Podium installation is denied due to IP address restriction.');
        Yii::warning('Access to Podium installation is denied due to IP address restriction. The requested IP is ' . $ip, __METHOD__);
        return false;
    }
public function checkAccess ( ) { if ( YII_ENV === 'test' ) { return true ; } $ ip = Yii :: $ app -> request -> getUserIP ( ) ; foreach ( $ this -> module -> allowedIPs as $ filter ) { if ( $ filter === '*' || $ filter === $ ip || ( ( $ pos = strpos ( $ filter , '*' ) ) !== false && ! strncmp ( $ ip , $ filter , $ pos ) ) ) { return true ; } } echo Yii :: t ( 'podium/view' , 'Access to Podium installation is denied due to IP address restriction.' ) ; Yii :: warning ( 'Access to Podium installation is denied due to IP address restriction. The requested IP is ' . $ ip , __METHOD__ ) ; return false ; }
Checks if user's IP is on the allowed list.
@see Podium::$allowedIPs
This method is copied from yii2-gii module.
@author Qiang Xue <qiang.xue@gmail.com>
@return bool
Checks if user s IP is on the allowed list .