Welcome Guest, Not a member yet? Register   Sign In
ci-3 how to create admin without duplicating core files
#11

I have in the past used multiplt installs of CI,

One for public/ ie hello world this is who we are
One for users/ ie logged in users
One for admin/

This is really over the top though and a bit pointless except it is very clean in the sense that all three can have very clean css, js and design separation, and very easy to bring one section down for maintenance whilst the others remain operational.

More recently I have one application and use authentication to divide off the different areas. Every controller in the admin checks for admin authorisation, etc.

I used hooks on a recent build to divide off the different responsibilities, to authorise for access before even reaching the controllers which worked very cleanly. Although since I still had to get user details in controllers anyway it felt a bit pointless.

Most recently I have relied solely on on install of CI and checking in the controllers a level of authorisation dependent on the controller being called. It is a one line call in the controller to a members library that either redirects to an appropriate login page if the user fails authorization for a particular part of the site or returns the users details if they are allowed. I have found this to be the most simple approach to this. Especially as the library is easily portable between sites for future use.

Although I have left it manual at the moment, a simple change to the library means that if admin section needs to be worked on and inaccessible for a while, logged in admin users are redirected to a holding page 'site under mainetenance', while super users (ie me) can still access for testing, whilst the rest of the site operates as normal. Although this could be automated to a setting in the admin dashboard, I have no reason to do so at the moment.

So in summary, Skunkbad and InsiteFX answers I completely agree with. Just use your authentication to see if they are allowed access to admin or not.

Paul.
Reply
#12

Thank you for all, I will start working on it as per the suggestions given.....
Reply




Theme © iAndrew 2016 - Forum software by © MyBB