Your IP : 216.73.216.48


Current Path : /hdd/hdd11/www/codedit/models/forms/
Upload File :
Current File : /hdd/hdd11/www/codedit/models/forms/AddIpRestrictionForm.php

<?php

namespace app\models\forms;

use Yii;
use yii\base\Model;
use app\models\MembersRestrictedIps;

class AddIpRestrictionForm extends Model {

    public $ip_address;

    public function rules() {
        return [
            [['ip_address'], 'required'],
            [['ip_address'], 'safe'],
        ];
    }

    public function attributeLabels() {
        return [
            'ip_address' => Yii::t('app', 'IP адрес'),
        ];
    }

    public function addRestriction($memberID) {
        $restrictedIps = new MembersRestrictedIps();
        return $restrictedIps->addRestriction($memberID, $this->ip_address);
    }

}