public function getContact($datacms) { $model = new ContactForm(); if (isset($_POST['ContactForm'])) { die; $model->attributes = $_POST['ContactForm']; $model->email = trim($model->email); if ($model->validate()) { // $email_to = Yii::app()->params['adminEmail']; $email_to = "*****@*****.**"; SendEmail::sendMailContact($model, $email_to); Yii::app()->user->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); $this->redirect(Yii::app()->createAbsoluteUrl('page/contact-us')); } } $this->render('contact-us', array('model' => $model)); }
$criteria->compare('t.role_id', ROLE_REGISTER_MEMBER); $criteria->compare('t.application_id', FE); $mUser = Users::model()->find($criteria); if (!$mUser) { $model->addError('email', 'Email does not exist.'); } elseif ($mUser->status == STATUS_ACTIVE) { $password = substr(uniqid(rand(), 1), 1, 10); $pass_en = md5($password); $mUser->password_hash = $pass_en; $mUser->temp_password = $password; $mUser->update(array('password_hash', 'temp_password')); SendEmail::forgotPassword($mUser, $password, ROLE_REGISTER_MEMBER); Yii::app()->user->setFlash('success', "An email with your new password has been sent to " . $mUser->email . "\r\r <br/>Please check your inbox.\r\r <br/>If you do not receive the email, please add \"@properyinfo.sg\" to your mailbox safe list and check your Junk/Spam mailbox."); if (isset($_POST['back'])) { $this->redirect(Yii::app()->createAbsoluteUrl('site/login')); } } else { $model->addError('email', 'Email does not exist.'); } } } $this->render('forgot_password/forgot_password', array('model' => $model)); } } catch (Exception $exc) { throw new CHttpException(404, 'Invalid request. Please do not repeat this request again.'); } } public function actionError() { if ($error = Yii::app()->errorHandler->error) { if (Yii::app()->request->isAjaxRequest) { echo $error['message'];