summaryrefslogtreecommitdiff
path: root/framework/gii/components/UserIdentity.php
blob: 9de480ee2cf2377aadf1ddcc003e3268c0bfb607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

class UserIdentity extends CUserIdentity
{
	/**
	 * Authenticates a user.
	 * @return boolean whether authentication succeeds.
	 */
	public function authenticate()
	{
		$password=Yii::app()->getModule('gii')->password;
		if($password===null)
			throw new CException('Please configure the "password" property of the "gii" module.');
		else if($password===false || $password===$this->password)
			$this->errorCode=self::ERROR_NONE;
        else
            $this->errorCode=self::ERROR_UNKNOWN_IDENTITY;
		return !$this->errorCode;
	}
}