Welcome Guest, Not a member yet? Register   Sign In
Oh my God!!
#1

[eluser]cobolCowboy[/eluser]
I found this in a blog, and it couldn't be more indicative of myself if I were the one to have written it.
Quote:If non-conformity and “impudence” are the first ingredients in the astonishing creativity of a man such as Einstein, as I said here, are there yet other ingredients? Of course. And the most important, in my opinion, is an appreciation of simplicity.

More than most people I know, I yearn for simplicity in my life–on my desk, in my file folders, in my home decoration, in my writing, my sentences and of course my thoughts. Quite probably, that is because there is far too much complexity in all of these.

I'm running CI under WAMP, and I've removed the need for index.php in the URL.
I've also built a separate controller for each page on the site so they can be reference as such
Quote: http://www.site.com/home
http://www.site.com/aboutus
http://www.site.com/contactus

Is it wrong of me to think that I can maintain the backend of the site with a controller called Admin that uses login authentication to protect it's functions?

I thought it would be as simple as setting up a controller called Admin which would contain the admin toolbox of functions secured by a Login function and accessed by
Quote: http://www.site.com/admin


There are those who suggest the need for "multiple site" scenarios, a frontend and a backend, if you will, none of which I've been able to get to work.

Is there a simpler approach to having an Admin side of the site other than simply building an Admin controller? Or is there something fundamentally wrong with this approach?
#2

[eluser]Colin Williams[/eluser]
One controller per resource, containing all of the necessary actions to manage that resource, some of which are protected by access control. Sounds like all you have are pages, so I would have a Page controller, with functions like edit, create, delete, which the user must log into to access.

Code:
class Page extends Controller {

   function Page()
   {
      parent::Controller();
      $method = $this->uri->rsegment(2);
      if (in_array($method, array('create', 'edit', 'delete'))) // Array of protected methods
      {
         $this->user_api->require_access('manage content', 'session/create');
         // Args: $permission, $redirect
      }
   }

}




Theme © iAndrew 2016 - Forum software by © MyBB