How can i get "ID" of User

I have a form that to login. I try to customize 2 file:

UserController.php and UserIdentity.php


public function authenticate()

	{

		$user=User::model()->find('LOWER(email)=?',array(strtolower($this->email)));

		if($user===null)

			$this->errorCode=self::ERROR_E_INVALID;

		else if(md5($this->password)!==$user->password)

               // else if(md5(md5($this->password).Yii::app()->params["salt"])!==$user->password)

			$this->errorCode=self::ERROR_PASSWORD_INVALID;

		else

		{

			$this->_id=$user->id;

			$this->email=$user->email;

			$this->errorCode=self::ERROR_NONE;

		}

		return !$this->errorCode;

	}

How create a Login page ?

please help me

You don’t have to set _id.

You can access user id from Yii::app()->user->id as any other field of user model

Thanks

But . That I want to know : how to check authentication.

a login