Welcome Guest, Not a member yet? Register   Sign In
Admin Class
#1

[eluser]GI-Joe[/eluser]
I have to create a Admin class which should be accessible to admin only.
I have maintain same DB table for admin and other users containing username and passwords and level(say 0 for User, 1 for Admin).

Once the user login system will check his level and create session for it.

How should I create the session as I am new to CodeIgniter please help me out. I have separate controller and model for users. Login verification is done in user model itself.

Where and how should I create session for level of user.

Please let me know if I am going wrong

Can I do something like this

Code:
Class Admin extends CI_Controller
{

function __construct()
{
  /* Can I check the level through session here so that only admin can access this class.
If user is not admin he will be redirected to user home page if he tried to access the methods in this controller class via URL */

}

}


Please do reply and help me as I am new to this framework.
If you have better solution please do post it.



Messages In This Thread
Admin Class - by El Forum - 06-08-2012, 08:37 AM
Admin Class - by El Forum - 06-08-2012, 08:50 AM
Admin Class - by El Forum - 06-08-2012, 09:41 AM
Admin Class - by El Forum - 06-08-2012, 09:55 AM
Admin Class - by El Forum - 06-08-2012, 09:57 AM
Admin Class - by El Forum - 06-08-2012, 10:01 AM
Admin Class - by El Forum - 06-08-2012, 12:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB