• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing Admin/User/Public controllers to insure authentication

#3
well for me my application requires a separate parent controller for admin's so i created a MY_Controller and a Admin_Controller under: application/core folder.

in the MY_Controller.php create your class, then at the end of the file outside the MY_Controller Class i put this chunk of code:

Code:
if ( ! class_exists('Admin_Controller'))
{
    require_once APPPATH.'core/Admin_controller.php';
}

in your admin_controller __construct method you would put your check(s) to ensure only certain member groups can access it and any child controllers.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply


Messages In This Thread
RE: Writing Admin/User/Public controllers to insure authentication - by Hobbes - 12-23-2014, 08:18 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.