PATH:
home
/
letacommog
/
letaweb
/
admin
/
models
/
mainsite_models
<?php /** * UserIdentity represents the data needed to identity a user. * It contains the authentication method that checks if the provided * data can identity the user. */ class UserIdentity extends CUserIdentity { public $_name; public $_id; public $_email; public $_password; public $_is_admin; public $_token; const ERROR_USER_INACTIVE = 113; public function __construct($email, $password) { $this->_email = $email; $this->_password = $password; } public static function getUserFromToken($token) { $user_id = (int) $token->id; $user = User::model()->findByPk($user_id); if ($user) { $userIdentity = new self(1, 1); $userIdentity->_id = $user->id; $userIdentity->_email = $user->email; $userIdentity->_name = $user->name; $userIdentity->errorCode = self::ERROR_NONE; } return $userIdentity; } public function authenticate() { $user = User::model()->find('LOWER(email) = :email', array(':email' => strtolower($this->_email))); if ($user === null) { $this->errorMessage = 'ERROR_USERNAME_INVALID'; $this->errorCode = self::ERROR_USERNAME_INVALID; } elseif (crypt($this->_password, $user->password) !== $user->password) { $this->errorMessage = $this->_password.crypt($this->_password, $user->password);//'ERROR_PASSWORD_INVALID'; $this->errorCode = self::ERROR_PASSWORD_INVALID; } elseif ($user->is_active == 0) { $this->errorCode = self::ERROR_USER_INACTIVE; } else { $this->_id = $user->id; $this->_email = $user->email; $this->_name = $user->name; $this->_is_admin = $user->is_admin == 1; $this->errorCode = self::ERROR_NONE; } return $this->errorCode == self::ERROR_NONE; } /** * @return int the ID of the user record */ public function getId() { return $this->_id; } public function getEmail() { return $this->_email; } public function getName() { return $this->_name; } public function getIsAdmin() { return $this->_is_admin; } public function getPassword() { return $this->_password; } public function getToken() { return $this->_token; } }
[+]
..
[-] Ticket.php
[edit]
[-] Configuration.php
[edit]
[-] PlanCondition.php
[edit]
[-] ModuleCategory.php
[edit]
[-] SamplePageCategory.php
[edit]
[-] Page_Type.php
[edit]
[-] Zone_Templates.php
[edit]
[-] User_Data.php
[edit]
[-] PlanDescription.php
[edit]
[-] UserData.php
[edit]
[-] Purchase.php
[edit]
[-] WebUser.php
[edit]
[-] Term.php
[edit]
[-] Type.php
[edit]
[-] Template.php
[edit]
[-] Site.php
[edit]
[-] Payment.php
[edit]
[+]
forms
[-] Language.php
[edit]
[-] AuthItem.php
[edit]
[-] MailTemplate.php
[edit]
[-] TicketForm.php
[edit]
[-] ModuleData.php
[edit]
[-] UserIdentity.php
[edit]
[-] Popup_Script.php
[edit]
[-] UserRecoverPassword.php
[edit]
[-] HelpCategory.php
[edit]
[-] Color.php
[edit]
[-] PlanAddition.php
[edit]
[-] Plan.php
[edit]
[-] IPNLogMessage.php
[edit]
[-] Subscription.php
[edit]
[-] SamplePage.php
[edit]
[-] ModuleList.php
[edit]
[-] User.php
[edit]
[-] Page_Domain.php
[edit]
[-] Payment_Method.php
[edit]
[-] YiiLog.php
[edit]
[-] User_Session.php
[edit]
[-] SkinPreset.php
[edit]
[-] Page_Installation.php
[edit]
[-] SiteData.php
[edit]
[-] Content.php
[edit]
[-] Library_Script.php
[edit]
[-] WebsiteCategory.php
[edit]