Yii Framework Forum: incorrect documentation on skeleton code - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

incorrect documentation on skeleton code Rate Topic: -----

#1 User is offline   DarkNSF 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 287
  • Joined: 12-November 08
  • Location:Palm Bay, Florida

Posted 16 November 2008 - 04:28 PM

authenticate() does not take any params, but the CUserIdentity constructor does.


<?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
{
/**
* Validates the username and password.
* This method should check the validity of the provided username
* and password in some way. In case of any authentication failure,
* set errorCode and errorMessage with appropriate values and return false.
* @param string username
* @param string password
* @return boolean whether the username and password are valid
*/
public function authenticate()
{
if($this->username==='demo' && $this->password==='demo')
$this->errorCode=self::ERROR_NONE;
else
$this->errorCode=self::ERROR_PASSWORD_INVALID;
return !$this->errorCode;
}
}

0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 16 November 2008 - 04:43 PM

Thank you. It's fixed.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users