- Registro, activación y entrada de usuarios git-svn-id: https://192.168.0.254/svn/Rodax.factuges_web/trunk@2 e455b18d-f7fe-5245-9c43-e2c35af70a32
31 lines
1.1 KiB
PHP
31 lines
1.1 KiB
PHP
<?php
|
|
|
|
class ActivationController extends Controller
|
|
{
|
|
public $defaultAction = 'activation';
|
|
|
|
|
|
/**
|
|
* Activation user account
|
|
*/
|
|
public function actionActivation () {
|
|
$email = $_GET['email'];
|
|
$activkey = $_GET['activkey'];
|
|
if ($email&&$activkey) {
|
|
$find = User::model()->notsafe()->findByAttributes(array('email'=>$email));
|
|
if (isset($find)&&$find->status) {
|
|
$this->render('/user/message',array('title'=>UserModule::t("User activation"),'content'=>UserModule::t("You account is active.")));
|
|
} elseif(isset($find->activkey) && ($find->activkey==$activkey)) {
|
|
$find->activkey = UserModule::encrypting(microtime());
|
|
$find->status = 1;
|
|
$find->save();
|
|
$this->render('/user/message',array('title'=>UserModule::t("User activation"),'content'=>UserModule::t("You account is activated.")));
|
|
} else {
|
|
$this->render('/user/message',array('title'=>UserModule::t("User activation"),'content'=>UserModule::t("Incorrect activation URL.")));
|
|
}
|
|
} else {
|
|
$this->render('/user/message',array('title'=>UserModule::t("User activation"),'content'=>UserModule::t("Incorrect activation URL.")));
|
|
}
|
|
}
|
|
|
|
} |