EDIT: Mods, feel free to delete this topic.
I’m having trouble getting authentication working.
In the file: protected/components/UserIdentity.php
I have the following line:
$user = User::model()->findByAttributes(array('email'=>$this->username));
This leads to the creation of this Criteria Object, which seems about right to me:
[indent]CDbCriteria Object ( [select] => * [distinct] => [condition] => t
.email
=:yp0 [params] => Array ( [:yp0] => address@example.com ) [limit] => -1 [offset] => -1 [order] => [group] => [join] => [having] => [with] => [alias] => [together] => [index] => [_e:CComponent:private] => [_m:CComponent:private] => ) [/indent]
The only trouble is that the user in the database (with “email” value “address@example.com”) is not getting found because the query being performed (according to the log) is:
[indent]13:28:15.102648 trace system.db.CDbCommand
Querying SQL: SELECT * FROM mydatabase
.user
t
WHERE t
.email
=:yp0 LIMIT 1[/indent]
There are two problems here that I can see:
-
the “AS” is missing before the table name alias
-
the parameters are not getting bound
Any ideas about what might be going on? (Using Yii version 1.1.5, Apache 2, PHP 5.3, Firefox 3.6)
(I’m guessing I haven’t configured something right, but then the database driven sessions are working properly…)