Added LogIn (pw in db)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user