User - Admin or guest

I am using the authenticate function in the UserIdentity component to check a users details in the database. This works fine. In my database table User I have a column called admin (0 = guest 1 = admin). How do I set this in this function, then call it in my scripts to determine if the user has admin privliages (1) or guest privlages (0).

public function authenticate()





	else if(!$user->validatePassword($this->password))








	return $this->errorCode==self::ERROR_NONE;



$rights = $user->admin;

are you sure it works?


Yeah is there anything you might think is wrong with that?

I’m about parameters in find method. I usually write something like this:

$user = User::model()->find(array(

	'condition' => 'LOWER(email) = :email',

	'params' => array(':email' => strtolower($this->username)),


But if it works no difference :)


Hehe, i thought i’ve read this syntax somewhere in the guide - but i guess i was wrong. The only place this way of passing parameters is mentioned seems to be in the API docs for bindParam/bindValue which are used by AR internally. So, that’s why this works, too. Just curious, can you tell where you learned this syntax?