Skip to content

Commit

Permalink
Account adopted for IpValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Jun 2, 2015
1 parent 8798333 commit 95e5af1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions models/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use hipanel\helpers\ArrayHelper;
use hipanel\modules\client\validators\LoginValidator;
use hipanel\validators\IpAddressValidator;
use hipanel\validators\IpValidator;
use Yii;

class Account extends \hipanel\base\Model
Expand Down Expand Up @@ -89,10 +89,7 @@ public function rules()
[
'sshftp_ips',
'each',
'rule' => [
IpAddressValidator::className(),
'exclusion' => true
],
'rule' => [IpValidator::className(), 'negationChar' => true, 'subnet' => null],
'on' => ['create-user', 'create-ftponly', 'update', 'set-allowed-ips']
]
];
Expand Down
3 changes: 2 additions & 1 deletion views/account/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
'data' => [
'title' => Yii::t('app', 'IP restrictions'),
'content' => Yii::t('app', 'Text about IP restrictions'),
]
],
'value' => $model->getSshFtpIpsList()
]);
?>

Expand Down

0 comments on commit 95e5af1

Please sign in to comment.