12 'class' =>
'CCaptchaAction',
13 'backColor' => 0xFFFFFF,
18 'class' =>
'CViewAction',
34 if (isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'login-form') {
35 echo CActiveForm::validate($model);
40 if (isset($_POST[
'LoginForm'])) {
41 $model->attributes = $_POST[
'LoginForm'];
43 if ($model->validate() && $model->login())
45 $this->redirect(
'index.php?r=home');
48 $this->render(
'login', array(
'model' => $model));
55 if ($error = Yii::app()->errorHandler->error) {
56 if (Yii::app()->request->isAjaxRequest)
57 echo $error[
'message'];
59 $this->render(
'error', $error);
68 if (isset($_POST[
'ContactForm'])) {
69 $model->attributes = $_POST[
'ContactForm'];
70 if ($model->validate()) {
71 $name =
'=?UTF-8?B?' . base64_encode($model->name) .
'?=';
72 $subject =
'=?UTF-8?B?' . base64_encode($model->subject) .
'?=';
73 $headers =
"From: $name <{$model->email}>\r\n" .
74 "Reply-To: {$model->email}\r\n" .
75 "MIME-Version: 1.0\r\n" .
76 "Content-type: text/plain; charset=UTF-8";
78 mail(Yii::app()->params[
'adminEmail'], $subject, $model->body, $headers);
79 Yii::app()->user->setFlash(
'contact',
'Thank you for contacting us. We will respond to you as soon as possible.');
83 $this->render(
'contact', array(
'model' => $model));
93 if (isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'login-form') {
94 echo CActiveForm::validate($model);
99 if (isset($_POST[
'LoginForm'])) {
100 $model->attributes = $_POST[
'LoginForm'];
102 if ($model->validate() && $model->login())
103 $this->redirect(Yii::app()->user->returnUrl);
106 $this->render(
'login', array(
'model' => $model));
113 Yii::app()->user->logout();
114 $this->redirect(Yii::app()->homeUrl);
135 $model =
new Users(
'register');
137 Yii::import(
'application.extensions.phpmailer.JPhpMailer');
140 if (isset($_POST[
'Users'])) {
141 $model->attributes = $_POST[
'Users'];
144 if ($model->validate()) {
148 $usermail=$model->email;
152 $mail->Host =
'smtp.googlemail.com:465';
153 $mail->SMTPSecure =
"ssl";
154 $mail->SMTPAuth =
true;
155 $mail->Username =
'jjjuk7@gmail.com';
156 $mail->Password =
'klizma23';
157 $mail->SetFrom(
'jjjuk7@gmail.com',
'HackedHard');
158 $mail->Subject =
'Welcome To EliteConf';
159 $mail->AltBody =
'To view the message, please use an HTML compatible email viewer!';
160 $mail->MsgHTML(
'<h1>You have successfully registered to EliteConf Conference Managagement System.</h1>');
161 $mail->AddAddress($usermail,
'Hacked Hard');
165 $this->redirect(
'index.php');
169 $this->render(
'register', array(
'model' => $model));
184 if (isset($_POST[
'Conference'])) {
185 $model->attributes = $_POST[
'Conference'];
186 $uid = Yii::app()->user->id;
187 $command = Yii::app()->db->createCommand();
189 if ($model->validate()) {
192 $cid = $model->conferenceid;
193 $command->insert(
'conference_user', array(
195 'conferenceid' => $cid,
197 $command->insert(
'conference_user_type', array(
200 'conferenceid' => $cid,
203 $this->redirect(
'index.php?r=home/index');
207 $this->render(
'request_conference', array(
'model' => $model));
211 $filecontent = file_get_contents(Yii::getPathOfAlias(
'application.uploads') .
'/' .
'schedule.pdf');
212 header(
"Content-Type: application/pdf");
213 header(
"Content-disposition: attachment; filename='schedule.pdf'");
214 header(
"Pragma: no-cache");