Exemplo n.º 1
0
 public function actionComment()
 {
     $model = new CommentForm();
     if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
         Yii::$app->session->setFlash('commentFormSubmitted');
         StoreUtils::sendPendingEmails();
         return $this->refresh();
     }
     return $this->render('comment', ['model' => $model]);
 }
Exemplo n.º 2
0
 public function actionForgotPassword()
 {
     $this->layout = 'login';
     $model = new AdminLoginForm();
     $show = 'login';
     $username = Yii::$app->request->post('username');
     /** @var DestinationAccount $destination */
     $destination = DestinationAccount::find()->where(['email' => $username])->one();
     if (!is_null($destination)) {
         $destination->generateEmailForgotPassword();
         StoreUtils::sendPendingEmails();
         $model->username = $destination->email;
         Yii::$app->session->setFlash('general-info', Yii::t('app', 'An email with the information you requested was successfully sent to {email}', ['email' => $destination->email]));
     } else {
         $show = 'password';
         Yii::$app->session->setFlash('password-error', Yii::t('app', 'The email address you provided could not be found'));
     }
     return $this->render('login', ['model' => $model, 'show' => $show]);
 }
Exemplo n.º 3
0
 public function actionForgotPassword()
 {
     $username = Yii::$app->request->post('username');
     /** @var User $model */
     $model = User::find()->where(['email' => $username])->one();
     if (!is_null($model)) {
         $model->generateEmailForgotPassword();
         StoreUtils::sendPendingEmails();
     }
     return $this->renderPartial('_forgot_password', ['model' => $model]);
 }