如何限制普通用户访问管理区域?

I'm trying to create a cms which has different user groups. Say admin and registered What i want to do here is that i want only the admin to have the access to admin folder and others whether they are usual users or any other i want to restrict the access to admin folder

// Here is what i have in my db
tabalename.groups (id,name) values (1, 'registered),(2,'admin')

I am assigning these group names by giving the user a group_id but i know it does not have anything to do with the access

So How do i do that in php ??

Your help is appreciated :)

This is one way your table could look like with an extra column status to denote the accessibility level of the user.

------------------------------
id | username    | status
1  | emkay992    | admin
2  | ayeshacutie | registered
------------------------------

And When logging in, compare the values from that column status in database and redirect through header(); as appropriate.