Oct
Semi Transparent Advanced User Control Library
Filed Under (Php) by admin on 01-10-2008
Tagged Under : CodeIgniter, Php5, Semi Transparent, User Control Library
Hi, here is the promised Semi Transparent Advanced User Control Library.
You can download it from here.
So lets see, what is semi transparent advanced user control library ?
Semi transparent advanced user control library, which i will call it SPINA AUCL, is a library that lets you manage users action in your application transparently, i mean you dont have to change your application that has been written on codeigniter library a bit. But the semi part comes from a minor modification which is, in default you should extend your controller classes by Controller as you all know, but in this case you should extend them from SPINA_Controller and that is it. SPINA_Controller also extends the CodeIgniters Controller library which lets you to directly reach to Controllers methods as it is before, instead SPINA_Controller lets your application pre load some methods that controlls the user and its action.
Long story short, if you try to reach for instance default_controller/index, the SPINA_Controllers ‘_remap’ method initiates and checks if any record is exist in database about reaching to that method. If not, function accepts that user as guest and lets user make that action, but if a row exist in db, then checks if the user has previleges to reach that method. that is it.
Now, lets start with the basics then we go to advanced subtopics. Anyway, before starting to show the example if you want to try it yourself, please create a new web site in your testing server, otherwise i will assume that you have already created a new web site and configure your database with the given sql in the rar file.
Lets assume that you have created a user with ID = 1 and again created a new row at h2b_roles_users (relation table) and set the new user to Administrator. (The given sql contains an example).
Now lets see how the system reacts now.








