[SOLVED] Using Ion Auth to secure website section - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [SOLVED] Using Ion Auth to secure website section (/showthread.php?tid=245) |
[SOLVED] Using Ion Auth to secure website section - yhoiseth - 11-13-2014 Hi, everyone. I'm trying to secure the entire members' area of a website using Ion Auth. I have managed blocking the default page (the index() function) in the following way: PHP Code: class Minside extends CI_Controller // Members' area to view orders, change user details and view public profile If the user isn't logged in, they can't access example.com/minside. But they can still access example.com/minside/offentlig_profil. How can i block access to the entire /minside website section without using the same if-statement in all the functions? RE: Using Ion Auth to secure website section - tapan.thapa - 11-13-2014 Make a constructor and try this.. Code: public function __construct() { RE: Using Ion Auth to secure website section - yhoiseth - 11-13-2014 That worked, tapan.thapa. Thanks a lot for your quick and helpful reply. I deeply appreciate the effort. |