Welcome Guest, Not a member yet? Register   Sign In
Right way to create admin backend.
#1

[eluser]rreynier[/eluser]
I want my site to have a front end that allows normal users to login. Upload pictures.. post on forum.. etc. Then a backend where admins go to further manage the site.

Currently my site will be structured with having a controller for each link in the main navigation. (Home -> home.php , Gallery -> gallery.php, Forums -> forums.php etc).

I looked around for a good authentication helper and decided on using Tank Auth

Now im trying to plan out the flow and structure of the front end and back end.Maybe I should have a separate codeigniter installation in a different folder for the back end? Or, should have a an "backend" controller. But then my backend controller will be HUGE since it would have to manage the Gallery, Events, Content.. etc.

Really.. im just not sure how best to approach this project so any input would be greatly appreciated!
#2

[eluser]jedd[/eluser]
Have you considered having admin functions (or 'backend' functions if you prefer) in your various controllers (or 'front-end' if you prefer).

This would mean you'd code a single Gallery controller, for example, and it would contain normal gallery-esque methods that would work for a non-admin and admin alike, as well as providing extra adminy functionality whenever an admin was in the room.
#3

[eluser]rreynier[/eluser]
I had not thought of that. I guess I would just have it call a different template ( a back end template lets say ). The only problem I see then is that if ur logged in as admin ur forced into the backend.
#4

[eluser]jedd[/eluser]
I'm not sure I get the Sumerian references here.

It might help if you stop thinking in terms of back end and front end systems, and instead think of methods - some are of interest to users only, some are of interest to admins only, and some are going to be hybrid - showing different information based on the rights of the user.

Admin users would normally have a non-admin account to play with anyway, I find. But even if they don't, I can't see how this approach is restrictive.
#5

[eluser]rreynier[/eluser]
im not sure what you mean by sumerian references.

either way, im not shooting down your ideas at all , just trying to understand. im all about learning and figuring out the best way to do things. im thinkin about joomla, how it for example has a "front end" and "backend". but im tryin to view it in a method sort of way.

how would you propose a gallery controller would work.. what functions and methods would it have?

view_images, view_image, edit_image, upload_image, delete_image.. like such?
#6

[eluser]skunkbad[/eluser]
You can check out my Community Auth, link in signature below. It provides a multi-user-level environment. There are probably other good choices in the wiki also.

In Community Auth, users who meet the required level are shown content that is specified to their level or lower. You can set it to a specific level as well. If nothing else, it would show you an example to build your own. Lots of work done here, so if it meets your needs, you'd be saving yourself a lot of time.
#7

[eluser]jedd[/eluser]
[url="http://en.wikipedia.org/wiki/Ur"]Ur[/url]

Quote:im thinkin about joomla, how it for example has a "front end" and "backend". but im tryin to view it in a method sort of way.

Certainly, there's several ways you can approach the challenge.

Quote:how would you propose a gallery controller would work.. what functions and methods would it have?

view_images, view_image, edit_image, upload_image, delete_image.. like such?

Noting that functions within a class are methods, I'd suggest you'd have have the obvious ones - search, view, perhaps a browse variant of view, upload, delete. Depending how you're doing your authentication - one admin takes all, or a more granular approach, as per skunkbad's or other auth libraries would provide for - you'd possibly approach the different-people-see-different things, well, differently. Consider delete. Normally you'd have the option for the owner of the image to delete it. You might have moderators for the gallery, who'd also have this right - it might even be limited to moderators of a particular sub-gallery. And, of course, admins have that right too. But if you have the 'back end' approach then you have to either provide normal user's a window into that world for their own images, or duplicate the delete functionality in the front end (for normal users) and in the back end (for privileged users).
#8

[eluser]Colin Williams[/eluser]
I sense a lot of trepidation here, rreynier. Jump in and go for it. Try all methods if you want.




Theme © iAndrew 2016 - Forum software by © MyBB