Admin Login check

Hi All,

this is my first post and i have just started with YII.

I have installed YII and successfully created admin module.

I have created login form from CFormModel.

now i want to validate the admin user. Do i need to use default site authentication that is present in protected/UserIdentity.php or do i need to create additional action in the admin/DefaultController for checking admin credentials.

You can use the default UserIdentity.

From there, you can make changes to taste.

Ivo Renkema, Thanks a lot for your valuable reply.

I will try with the same and will let you know.

Regards

for an admin module you can create an overriding base controller in your module’s components folder (Controller.php) and apply some access rules to the entire module. Watch out though, the way I have it written below would allow anybody authenticated as a user to access the module… you might want to change the access rules to be more specific to an admin user if you have public users in your database as well. and if you’re using gii generated code, you’d take the filters and accessRules out of each models individual controllers or they will override these settings…

class Controller extends CController

{

   	public function filters()


{


        return array(


                'accessControl', // perform access control for CRUD operations


        );


}





    public function accessRules()


    {


        return array(


            array('deny',


                'users'=>array('?'),


            ),


        );


    }

}