Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:wampwwwtopicollprotectedcomponentsUserIdentity.php(21)
- 09 {
- 10 /**
- 11 * Authenticates a user.
- 12 * The example implementation makes sure if the username and password
- 13 * are both 'demo'.
- 14 * In practical applications, this should be changed to authenticate
- 15 * against some persistent user identity storage (e.g. database).
- 16 * @return boolean whether authentication succeeds.
- 17 */
- 18 public function authenticate()
- 19 {
- 20
- 21 $users = TblUser::model()->find('Email=?',array($this->Email));
- 22 // $user= TblUser::User::model()->find('LOWER(Email)=?',array(strtolower($this->Email)));
- 23 if($users===null)
- 24 $this->errorCode=self::ERROR_USERNAME_INVALID;
- 25 else if(!$users->validatePassword($this->password))
- 26 $this->errorCode=self::ERROR_PASSWORD_INVALID;
- 27 else
- 28 {
- 29 $this->_id=$users->id;
- 30 $this->Email=$users->Email;
- 31 $this->errorCode=self::ERROR_NONE;
- 32 }
- 33 return $this->errorCode==self::ERROR_NONE;
- Stack Trace
- #0
- – C:wampwwwtopicollprotectedcomponentsUserIdentity.php(21): CComponent->__get("Email")
- 16 * @return boolean whether authentication succeeds.
- 17 */
- 18 public function authenticate()
- 19 {
- 20
- 21 $users = TblUser::model()->find('Email=?',array($this->Email));
- 22 // $user= TblUser::User::model()->find('LOWER(Email)=?',array(strtolower($this->Email)));
- 23 if($users===null)
- 24 $this->errorCode=self::ERROR_USERNAME_INVALID;
- 25 else if(!$users->validatePassword($this->password))
- 26 $this->errorCode=self::ERROR_PASSWORD_INVALID;
- #1
- – C:wampwwwtopicollprotectedmodelsLoginForm.php(45): UserIdentity->authenticate()
- 40 * This is the 'authenticate' validator as declared in rules().
- 41 */
- 42 public function authenticate($attribute, $params) {
- 43 if (!$this->hasErrors()) {
- 44 $this->_identity = new UserIdentity($this->Email, $this->password);
- 45 if (!$this->_identity->authenticate())
- 46 $this->addError('password', 'Incorrect username or password.');
- 47 }
- 48 }
- 49
- 50 /**
- #2
- + C:wampwwwyiiframeworkvalidatorsCInlineValidator.php(43): LoginForm->authenticate("password", array())
- #3
- + C:wampwwwyiiframeworkvalidatorsCValidator.php(197): CInlineValidator->validateAttribute(LoginForm, "password")
- #4
- + C:wampwwwyiiframeworkbaseCModel.php(158): CValidator->validate(LoginForm, null)
- #5
- – C:wampwwwtopicollprotectedcontrollersSiteController.php(110): CModel->validate()
- 105 {
- 106 $model->attributes=$_POST['LoginForm'];
- 107
- 108 // var_dump($model);
- 109 // validate user input and redirect to the previous page if valid
- 110 if($model->validate() && $model->login())
- 111 {
- 112 $this->redirect(array('site/login', 'email'=>$model->Email));
- 113
- 114 echo $model->Email;
- 115
- #6
- + C:wampwwwyiiframeworkwebactionsCInlineAction.php(50): SiteController->actionLogin()
- #7
- + C:wampwwwyiiframeworkwebCController.php(309): CInlineAction->runWithParams(array("r" => "site/login"))
- #8
- + C:wampwwwyiiframeworkwebCController.php(287): CController->runAction(CInlineAction)
- #9
- + C:wampwwwyiiframeworkwebCController.php(266): CController->runActionWithFilters(CInlineAction, array())
- #10
- + C:wampwwwyiiframeworkwebCWebApplication.php(276): CController->run("login")
- #11
- + C:wampwwwyiiframeworkwebCWebApplication.php(135): CWebApplication->runController("site/login")
- #12
- + C:wampwwwyiiframeworkbaseCApplication.php(162): CWebApplication->processRequest()
- #13
- + C:wampwwwtopicollindex.php(13): CApplication->run()
- 2012-09-28 07:22:44 Apache/2.2.21 (Win32) PHP/5.3.8 Yii Framework/1.1.10
Add Comment
Please, Sign In to add comment