Multiple admin areas & user identification - best approach? |
I am completely new to CodeIgniter, so please bear with me.
To better understand and learn how CodeIgniter works, I am currently building a sample job board application with a login area using Ion Auth. The idea here is to have a super administrator, who has complete access to edit and manage users, posts, settings etc. and a normal user group, that can post and edit only their own jobs and profile details. With this in mind, I would like to show different admin-areas with different functions to the different user groups; one for the super-admin and one for the normal users. My question now is, how to organize these two admin-dashboards. I currently use a single controller "Dashboard.php" to basically load different menu-views depending on the users status (admin vs non-admin): PHP Code: <?php I am not sure if this is a good idea or if it is better to have a unique controller for every user group, also in order to define different methods for each group. I don't want to repeat much code regarding the views in the admin-area (i.e. basically same design but different menus). Also, another question concerns how to identify a specific user once he or she is logged in to the admin-area in order to only show his posts / user details. Is there a way to get the user ID and for instance save it in a session or what is the best approach here? Thanks for your feedback. |
Messages In This Thread |
Multiple admin areas & user identification - best approach? - by Neo - 10-30-2016, 07:43 AM
RE: Multiple admin areas & user identification - best approach? - by InsiteFX - 10-30-2016, 10:40 AM
RE: Multiple admin areas & user identification - best approach? - by cartalot - 10-30-2016, 12:47 PM
RE: Multiple admin areas & user identification - best approach? - by Neo - 10-30-2016, 04:59 PM
RE: Multiple admin areas & user identification - best approach? - by cartalot - 10-31-2016, 06:38 AM
|