Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntd committed Nov 1, 2017
1 parent 1e6b0b7 commit 32edc73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.3] - 2017-11-01
- `enh` Self-vote option (sokoji)
- `fix` Migration fix (sokoji)

## [0.2.5] - 2016-08-16
- `enh` PHP 5.4 Support

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The preferred way to install this extension is through [composer](http://getcomp
Either run

```
php composer.phar require --prefer-dist hauntd/yii2-vote "0.2.*"
php composer.phar require --prefer-dist hauntd/yii2-vote "0.3.*"
```

or add
Expand Down
2 changes: 1 addition & 1 deletion models/VoteForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function checkModel()
$allowSelfVote = ArrayHelper::getValue($settings, 'allowSelfVote', false);
if (!$allowSelfVote) {
$entityAuthorAttribute = ArrayHelper::getValue($settings, 'entityAuthorAttribute', 'user_id');
if(!Yii::$app->user->isGuest && Yii::$app->user->id == $entityModel->{$entityAuthorAttribute}) {
if (!Yii::$app->user->isGuest && Yii::$app->user->id == $entityModel->{$entityAuthorAttribute}) {
$this->addError('entity', Yii::t('vote', 'Self-voting are not allowed.'));
return false;
}
Expand Down

0 comments on commit 32edc73

Please sign in to comment.