HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
ActivationController.php
Go to the documentation of this file.
1 <?php
2 
4 {
5  public $defaultAction = 'activation';
6 
10  public function actionActivation()
11  {
12  $email = $_GET['email'];
13  $activkey = $_GET['activkey'];
14  if ($email && $activkey) {
15  $find = User::model()->notsafe()->findByAttributes(array('email' => $email));
16  if (isset($find) && $find->status) {
17  $this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("You account is active.")));
18  } elseif (isset($find->activkey) && ($find->activkey == $activkey)) {
19  $find->activkey = UserModule::encrypting(microtime());
20  $find->status = 1;
21  $find->save();
22  $this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("You account is activated.")));
23  } else {
24  $this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Incorrect activation URL.")));
25  }
26  } else {
27  $this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Incorrect activation URL.")));
28  }
29  }
30 }