Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
ActivationController Class Reference
Inheritance diagram for ActivationController:
Controller BaseController

Public Member Functions

 actionActivation ()

Public Attributes

 $defaultAction = 'activation'
- Public Attributes inherited from Controller
 $menu = array()
 $breadcrumbs = array()
- Public Attributes inherited from BaseController
 $layout = '//layouts/gportal'
 $mailLayout = '//layouts/mail'

Additional Inherited Members

- Protected Member Functions inherited from BaseController
 beforeAction ($action)

Detailed Description

Definition at line 3 of file ActivationController.php.

Member Function Documentation

ActivationController::actionActivation ( )

Activation user account

Returns
void

Definition at line 13 of file ActivationController.php.

References UserModule\encrypting(), User\model(), and UserModule\t().

{
$email = $_GET['email'];
$activkey = $_GET['activkey'];
if ($email && $activkey) {
$find = User::model()->notsafe()->findByAttributes(array('email' => $email));
if (isset($find) && $find->status) {
if (!isset($_GET['return_url'])) {
$this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Your account is active.")));
}
Yii::app()->user->setFlash('registration', UserModule::t("Your account is active."));
} elseif (isset($find->activkey) && ($find->activkey == $activkey)) {
$find->activkey = UserModule::encrypting(microtime());
$find->status = 1;
$find->save();
if (!isset($_GET['return_url'])) {
$this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Your account is activated.")));
}
Yii::app()->user->setFlash(Yii::app()->getModule('user')->userLoginWidgetFlashSuccess, UserModule::t('Your account is activated. Now you can log in.'));
$this->redirect($this->module->loginUrl);
} else {
if (!isset($_GET['return_url'])) {
$this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Incorrect activation URL.")));
}
Yii::app()->user->setFlash('registration', UserModule::t("Incorrect activation URL."));
}
} else {
if (!isset($_GET['return_url'])) {
$this->render('/user/message', array('title' => UserModule::t("User activation"), 'content' => UserModule::t("Incorrect activation URL.")));
}
Yii::app()->user->setFlash('registration', UserModule::t("Incorrect activation URL."));
}
$cleanUrl = AppHelper::removeParamsFromUrl($_GET['return_url'], array('email', 'activkey'));
$this->redirect($cleanUrl);
}

The documentation for this class was generated from the following file: