public static function checkIPRange($ip) { $ipRanges = Yii::app()->params['ipRanges']; foreach ($ipRanges as $range) { if (CUtils::cidrMatch($ip, $range)) { return true; } } return false; }