0
votes

I want to add the auth module in my application but when he's trying to access to the database, he doesn't use the right fields. This is the error page that I get with the request :

Database_Exception [ 1054 ]: Unknown column 'username' in 'where clause' [ SELECT user.id AS id, user.mail AS mail, user.login AS login, user.password AS password, user.nom AS nom, user.prenom AS prenom, user.telephone AS telephone, user.inscription AS inscription, user.active AS active, user.admin AS admin, user.rattachement AS rattachement, user.organisme AS organisme FROM utilisateur AS user WHERE username = 'l.rousseaux' LIMIT 1 ]

So in the where clause, he uses username and in my database, I use login. So my question is, where can I change this parameter for him to check the right field ?

Thanks in advance !

1
In Your ORM module Auth ORM has unique_key field for that. - Faraz
you can find it OEM-> Model -> User line 129 - Faraz
did you managed to find solution? - Faraz

1 Answers

0
votes

You can update the unique value field in Modules -> ORM -> Model -> user line 129

/**
* Allows a model use both email and username as unique identifiers for  login
*
* @param   string  unique value
* @return  string  field name
*/
public function unique_key($value)
{
   return Valid::email($value) ? 'email' : 'username';
}