1
0

Added LogIn (pw in db)

This commit is contained in:
2014-05-28 10:38:11 +02:00
parent d74a13f661
commit fa36f26f2e
9 changed files with 2851 additions and 143 deletions

View File

@@ -17,10 +17,14 @@ class UserIdentity extends CUserIdentity
*/
public function authenticate()
{
$connection = Yii::app()->db;
$command=$connection->createCommand("SELECT SValue FROM othervalues WHERE Name = 'AdminPassword'");
$pw = $command->queryScalar();
$users=array(
// username => password
'demo'=>'demo',
'admin'=>'admin', //TODO Change me
'admin' => $pw,
);
if(!isset($users[$this->username]))
$this->errorCode=self::ERROR_USERNAME_INVALID;