1 <?php
2
3 class ActivationController extends Controller
4 {
5 public $defaultAction = 'activation';
6
7
8 9 10
11 public function actionActivation () {
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
31 }