Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Help required - User logged in can see admin
#1

[eluser]the_unforgiven[/eluser]
Hi all,

I'm building an application but when a user is logged in they can still navigate to url.com/admin and access the admin side of things what can I do to stop this?

What is the best way?

Currently am just using the session data.
----------------------------------------------------
SOLVED BY DOING THIS:
Code:
function home()
{
  if ($this->session->userdata('group_id') == '1') { // THIS LINE WORKS
  $data['ptitle'] = "Dashboard";
  $data['heading'] = "Welcome";
  $this->load->view('admin/home', $data);
  }else { redirect('admin/restricted'); }
}




Theme © iAndrew 2016 - Forum software by © MyBB