Search the Community
Showing results for tags 'authentication'.
-
I have simple app built on yii2 basic. The data gathered through yii forms and models is used in another web service, and apart from the admin, no one needs to view or access the yii environment. Never the less I want to ensure the admin has to login to do anything, including view. The Site controller seems logical place to do this, but I am not finding this scenario obvious. Does access control have to be added to all affected controllers, or can I configure it once in sitecontroller and meet the objective? Mike B
-
Hi all! I started using Yii and I'm trying to authenticate users by db table from login form, but i'm getting in trouble with find() function. This is my UserIdentity's class: private $_id; public function authenticate() { $username = strtolower($this->username); $record=User::model()->find('LOWER(username)=?',array($username)); if($record===null) $this->errorCode=self::ERROR_USERNAME_INVALID; else if($record->password!==md5($this->password)) $this->errorCode=self::ERROR_PASSWORD_INVALID; else { $this->_id=$record->id;