13 'class' =>
'CCaptchaAction',
14 'backColor' => 0xFFFFFF,
19 'class' =>
'CViewAction',
32 $this->render(
'index');
40 if ($error = Yii::app()->errorHandler->error) {
41 if ($error[
'type'] ==
'CDbException') {
42 Yii::app()->errorHandler->__set(
'message',
'Failed to open the DB connection');
44 if (Yii::app()->request->isAjaxRequest)
45 echo $error[
'message'];
47 $this->render(
'error', $error);
57 if (isset($_POST[
'ContactForm'])) {
58 $model->attributes = $_POST[
'ContactForm'];
59 if ($model->validate()) {
60 $name =
'=?UTF-8?B?' . base64_encode($model->name) .
'?=';
61 $subject =
'=?UTF-8?B?' . base64_encode($model->subject) .
'?=';
62 $headers =
"From: $name <{$model->email}>\r\n" .
63 "Reply-To: {$model->email}\r\n" .
64 "MIME-Version: 1.0\r\n" .
65 "Content-Type: text/plain; charset=UTF-8";
67 mail(Yii::app()->params[
'adminEmail'], $subject, $model->body, $headers);
68 Yii::app()->user->setFlash(
'contact',
'Thank you for contacting us. We will respond to you as soon as possible.');
72 $this->render(
'contact', array(
'model' => $model));
83 if (isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'login-form') {
84 echo CActiveForm::validate($model);
89 if (isset($_POST[
'LoginForm'])) {
90 $model->attributes = $_POST[
'LoginForm'];
92 if ($model->validate() && $model->login())
93 $this->redirect(Yii::app()->user->returnUrl);
96 $this->render(
'login', array(
'model' => $model));
104 Yii::app()->user->logout();
105 $this->redirect(Yii::app()->homeUrl);