diff --git a/backend/modules/frontend/controllers/PlayerController.php b/backend/modules/frontend/controllers/PlayerController.php index ecb716db4..4d979ef69 100644 --- a/backend/modules/frontend/controllers/PlayerController.php +++ b/backend/modules/frontend/controllers/PlayerController.php @@ -86,7 +86,7 @@ public function actionIndex() public function actionClearVerificationToken($id) { $model = $this->findModel($id); - $model->updateAttributes(['verification_token' => null]); + \app\modules\frontend\models\PlayerToken::deleteAll(['player_id' => $model->id, 'type' => 'email_verification']); return $this->goBack((!empty(Yii::$app->request->referrer) ? Yii::$app->request->referrer : null)); } diff --git a/backend/modules/frontend/controllers/PlayerTokenController.php b/backend/modules/frontend/controllers/PlayerTokenController.php index b343b05f9..19b2e8cc7 100644 --- a/backend/modules/frontend/controllers/PlayerTokenController.php +++ b/backend/modules/frontend/controllers/PlayerTokenController.php @@ -22,7 +22,7 @@ public function behaviors() parent::behaviors(), [ 'verbs' => [ - 'class' => VerbFilter::className(), + 'class' => VerbFilter::class, 'actions' => [ 'delete' => ['POST'], ], diff --git a/frontend/widgets/target/HeadshotsWidget.php b/frontend/widgets/target/HeadshotsWidget.php index a0a5a715a..bd1219c63 100644 --- a/frontend/widgets/target/HeadshotsWidget.php +++ b/frontend/widgets/target/HeadshotsWidget.php @@ -22,7 +22,10 @@ public function init() public function run() { $headshots = []; - $sql = "SELECT player.id,player.username,profile.id as profile_id,profile.visibility FROM headshot LEFT JOIN player ON player.id=headshot.player_id LEFT JOIN profile on profile.player_id=player.id WHERE headshot.target_id=:target_id AND player.status=10 ORDER BY headshot.created_at DESC,headshot.player_id asc LIMIT 50"; + $academicStr=""; + if(\Yii::$app->sys->academic_grouping!==false) + $academicStr=" AND player.academic=".\Yii::$app->user->identity->academic; + $sql = "SELECT player.id,player.username,profile.id as profile_id,profile.visibility FROM headshot LEFT JOIN player ON player.id=headshot.player_id LEFT JOIN profile on profile.player_id=player.id WHERE headshot.target_id=:target_id AND player.status=10 {$academicStr} ORDER BY headshot.created_at DESC,headshot.player_id asc LIMIT 50"; $result = \Yii::$app->db->createCommand($sql, [':target_id' => $this->target_id])->cache(180)->query(); foreach ($result as $hs) {