Tank Auth v1.0 (CI authentication library) |
[eluser]brettalton[/eluser]
[quote author="RandyCram" date="1284734616"]So I am in the process of extending this for my use and I am not sure about one thing. I added a field named "admin" to the user table in the database to have a value or 0 or 1, and if 1 to display admin only items. However for some reason I can't get it to work right. I am not sure how I should do the check. I want the admin to be able to view the page so I don't want to redirect them right away i just want to display a link saying "Admin CP." I added this to the library Code: function get_admin() I tried adding it to the controller and doing an if $admin == 1 but it didn't work so what would the best method of doing this be? Thanks.[/quote] Well do you have the information being reported to <i>$this->ci->session->userdata</i> because, as I said in post #301, I wanted to pull out the user's e-mail address but since it didn't exist in the user data, I had to query the DB based on the user's ID. I haven't looked into it, but I should hack the lib to post that information to the session data so I'm not querying the DB on every page reload. I think you're looking to do the same thing. Does that make sense? |
Welcome Guest, Not a member yet? Register Sign In |