Пример #1
0
 public function validatePasswordRule($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $user = self::findByEmail($this->email);
         if (!$user) {
             $this->addError($attribute, Yii::t('account', 'Account not found.'));
         } elseif (!$user->validatePassword($this->password)) {
             $this->addError($attribute, Yii::t('account', 'Incorrect username or password.'));
         } elseif (($modelJob = UserJob::find()->where(['_id' => $user->primaryKey, 'role' => $this->role])->one()) == null) {
             $this->addError($attribute, Yii::t('account', 'Invalid Account. You are not allowed to access this page.'));
         } else {
             // Kiem tra xem Seeker da co day du thong tin Resume chua?
             if ($this->role == 'seeker' && ($modelUserJobSeekerResume = UserJobSeekerResume::findOne($user->primaryKey)) != null) {
                 Yii::$app->session->set('jobAccountResume', 1);
             }
             Yii::$app->session->set('jobAccountRole', $this->role);
         }
     }
 }
Пример #2
0
 public function actionInformation()
 {
     $model = UserJobSeekerResume::findOne(Yii::$app->user->id);
     if ($model == null) {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
     Yii::$app->view->title = Yii::t($this->module->id, 'Information');
     Yii::$app->view->params['breadcrumbs'][] = Yii::$app->view->title;
     return $this->render('information', ['model' => $model]);
 }