mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-10 18:16:53 +01:00
25 lines
692 B
PHP
25 lines
692 B
PHP
<?php
|
|
|
|
/**
|
|
* WebUser class.
|
|
* WebUser extends CWebUser by implementing authentication
|
|
* and other user-session related features.
|
|
*/
|
|
class WebUser extends CWebUser
|
|
{
|
|
/**
|
|
* Validates the username and password.
|
|
* This method is invoked by {@link CWebUser::login}.
|
|
* The default implementation simply checks if both
|
|
* username and password are 'demo'.
|
|
* In real applications, you normally validate them
|
|
* against a database.
|
|
* @param string username
|
|
* @param string password
|
|
* @return boolean whether the username and password are valid
|
|
*/
|
|
public function validate($username,$password)
|
|
{
|
|
return ($username==='demo' && $password==='demo');
|
|
}
|
|
} |