Guest User

Untitled

a guest
Jan 18th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. C:wampwwwtopicollprotectedcomponentsUserIdentity.php(21)
  2.  
  3. 09 {
  4. 10 /**
  5. 11 * Authenticates a user.
  6. 12 * The example implementation makes sure if the username and password
  7. 13 * are both 'demo'.
  8. 14 * In practical applications, this should be changed to authenticate
  9. 15 * against some persistent user identity storage (e.g. database).
  10. 16 * @return boolean whether authentication succeeds.
  11. 17 */
  12. 18 public function authenticate()
  13. 19 {
  14. 20
  15. 21 $users = TblUser::model()->find('Email=?',array($this->Email));
  16. 22 // $user= TblUser::User::model()->find('LOWER(Email)=?',array(strtolower($this->Email)));
  17. 23 if($users===null)
  18. 24 $this->errorCode=self::ERROR_USERNAME_INVALID;
  19. 25 else if(!$users->validatePassword($this->password))
  20. 26 $this->errorCode=self::ERROR_PASSWORD_INVALID;
  21. 27 else
  22. 28 {
  23. 29 $this->_id=$users->id;
  24. 30 $this->Email=$users->Email;
  25. 31 $this->errorCode=self::ERROR_NONE;
  26. 32 }
  27. 33 return $this->errorCode==self::ERROR_NONE;
  28. Stack Trace
  29. #0
  30. – C:wampwwwtopicollprotectedcomponentsUserIdentity.php(21): CComponent->__get("Email")
  31. 16 * @return boolean whether authentication succeeds.
  32. 17 */
  33. 18 public function authenticate()
  34. 19 {
  35. 20
  36. 21 $users = TblUser::model()->find('Email=?',array($this->Email));
  37. 22 // $user= TblUser::User::model()->find('LOWER(Email)=?',array(strtolower($this->Email)));
  38. 23 if($users===null)
  39. 24 $this->errorCode=self::ERROR_USERNAME_INVALID;
  40. 25 else if(!$users->validatePassword($this->password))
  41. 26 $this->errorCode=self::ERROR_PASSWORD_INVALID;
  42. #1
  43. – C:wampwwwtopicollprotectedmodelsLoginForm.php(45): UserIdentity->authenticate()
  44. 40 * This is the 'authenticate' validator as declared in rules().
  45. 41 */
  46. 42 public function authenticate($attribute, $params) {
  47. 43 if (!$this->hasErrors()) {
  48. 44 $this->_identity = new UserIdentity($this->Email, $this->password);
  49. 45 if (!$this->_identity->authenticate())
  50. 46 $this->addError('password', 'Incorrect username or password.');
  51. 47 }
  52. 48 }
  53. 49
  54. 50 /**
  55. #2
  56. + C:wampwwwyiiframeworkvalidatorsCInlineValidator.php(43): LoginForm->authenticate("password", array())
  57. #3
  58. + C:wampwwwyiiframeworkvalidatorsCValidator.php(197): CInlineValidator->validateAttribute(LoginForm, "password")
  59. #4
  60. + C:wampwwwyiiframeworkbaseCModel.php(158): CValidator->validate(LoginForm, null)
  61. #5
  62. – C:wampwwwtopicollprotectedcontrollersSiteController.php(110): CModel->validate()
  63. 105 {
  64. 106 $model->attributes=$_POST['LoginForm'];
  65. 107
  66. 108 // var_dump($model);
  67. 109 // validate user input and redirect to the previous page if valid
  68. 110 if($model->validate() && $model->login())
  69. 111 {
  70. 112 $this->redirect(array('site/login', 'email'=>$model->Email));
  71. 113
  72. 114 echo $model->Email;
  73. 115
  74. #6
  75. + C:wampwwwyiiframeworkwebactionsCInlineAction.php(50): SiteController->actionLogin()
  76. #7
  77. + C:wampwwwyiiframeworkwebCController.php(309): CInlineAction->runWithParams(array("r" => "site/login"))
  78. #8
  79. + C:wampwwwyiiframeworkwebCController.php(287): CController->runAction(CInlineAction)
  80. #9
  81. + C:wampwwwyiiframeworkwebCController.php(266): CController->runActionWithFilters(CInlineAction, array())
  82. #10
  83. + C:wampwwwyiiframeworkwebCWebApplication.php(276): CController->run("login")
  84. #11
  85. + C:wampwwwyiiframeworkwebCWebApplication.php(135): CWebApplication->runController("site/login")
  86. #12
  87. + C:wampwwwyiiframeworkbaseCApplication.php(162): CWebApplication->processRequest()
  88. #13
  89. + C:wampwwwtopicollindex.php(13): CApplication->run()
  90. 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