/**
  * Finds the YBoardSetting model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return YBoardSetting the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = YBoardSetting::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #2
0
 /**
  * Displays a single YBoardBan model.
  * @param integer $id
  * @return mixed
  */
 public function actionBanned($id)
 {
     $model = YBoardBan::findOne($id);
     $user = YBoardMember::findOne($model->user_id);
     $isIP = true;
     if ($user !== null) {
         $isIP = false;
     }
     if ($model == null) {
         throw new NotFoundHttpException(YBoard::t('yboard', 'The requested Banned User does not exist.'));
     }
     $settings = YBoardSetting::find()->where(['key' => 'email'])->one();
     return $this->render('banned', ['model' => $model, 'member' => $user, 'isIp' => $isIP, 'email' => $settings == null ? YBoard::t('board', 'no email') : $settings->value]);
 }