Welcome Guest, Not a member yet? Register   Sign In
Login system - feedback or pointers on planing it
#1

[eluser]überfuzz[/eluser]
I'm building a login system. There's going to be multiple access levels. Prior to this one I've checked the first segment of the url. On the server I've placed the protected controllers in folder, admin. Problem now it that I don't like to have a different url for every access level.

Code:
//this is how I usally do it. (In a my_controller.)
if($this->uri->segment(1) == 'admin')
{
   if($this->session->userdata('is_logged_in') != 1 )
   {
      redirect('login');
   }
}

Should I give every method in every controller different access levels? Then I could have a controller to manage stuff like profile. An example:
www.site.com/profile/
Level = 1 can see and edit profile.
Level = 2 can see and edit profiles.
Level = 3 can see, edit and set up new profiles
This would make it simpler to set up links. Different access levels can access the same link but have different possibility to reach functionality. I still have to set up urls where access level determine wish link that are going to be seen though.

Or should I try to stick to the one controller to rule them all concept..?
#2

[eluser]überfuzz[/eluser]
By the way, is there any suggestions of a nice auth library form CI?
#3

[eluser]rogierb[/eluser]
There are many many auth libraries. All with different features. I used Freakauth, before building my own.
Id did what it had to do. I hear a lot of positives on redux.

Just look for yourself
http://stackoverflow.com/questions/34698...ry-is-best
http://ericlbarnes.com/develop/codeignit...orization/




Theme © iAndrew 2016 - Forum software by © MyBB