I have been following along the Blog Tutorial (http://www.yiiframework.com/doc/blog/1.1/en/prototype.auth) and I decided to dig and find out where the demo and admin accounts are stored.
Specifically, I noticed I can’t log into the admin account in the Blog tutorial demo. (Though I can log into the “demo” account just fine).
Not sure if I messed something up as I was playing with all the code, but it got me to think "Where is the demo and admin account located" I do not have any entries in the tbl_users table, so I know Demo/Admin are not in a database, at least a MySQL one.
I searched through the source code to see if it was hardcoded but I came up dry. I know I could just add something like this to the "authenticate()" function in my UserIdentity.php class:
if ($this->$username == 'admin' && $this->password == 'admin') {
$this->errorCode=self::ERROR_NONE;
return true;
}
But when I do that, although the “invalid username/password” error goes away, I don’t actually log in.
So… I know my authentication is okay. But where does Yii get the default demo/admin user accounts?
(I think knowing this will help me solve the original program—why the admin account can’t be logged into. If this assumption is incorrect, I am very open to learn!).