Welcome Guest, Not a member yet? Register   Sign In
Easiest authentication - 1 user restricted access to a folder in my controllers?
#1

[eluser]mikka23[/eluser]
Hi this should be real simple for someone to answer. What is the easiest way for my to restrict access to my admin folder in my controllers folder? Its only going to be me to use it so I just want to secure the backend part of my cms. I tried a couple of the libraries but it was overly complicated for what I need.

All advice are greatly appreciated.
#2

[eluser]davidbehler[/eluser]
You could have a look at my auth library: http://ellislab.com/forums/viewthread/96433/

It can be setup to not use database at all and check for a fix user/password combination only. Guess that's all you need...
#3

[eluser]slowgary[/eluser]
or how about just using .htaccess authentication?
#4

[eluser]mikka23[/eluser]
How would I go about that, I believe its the easiest way.
#5

[eluser]slowgary[/eluser]
.htaccess allows you to specify files or folders that require authentication, then specify the location of your password file (usually people name this .htpasswd). So you'd have 1 .htaccess (easiest to just place it in the directory you wish to protect) and 1 password file (safest to place this above the web root). There are many sites that will help with these, even generate them for you. Try this one -> http://tools.dynamicdrive.com/password/

Even easier... most webhosts have a function for this. Does your host have cPanel, or an equivalent? If your use the software provided by your webhost to do this you avoid having to figure out the paths, and anything else that might get in your way.
#6

[eluser]mikka23[/eluser]
Cpanel does but only for directories. My admin area is called by domain.com/index.php/admin. This is obviously not an actual directory however so surely i need to block that url specifically?

I tried restricting access to the admin folder in my controller through cpanel but that has done nothing.
#7

[eluser]slowgary[/eluser]
I see... that's because there is no admin folder, it's just a URI passed to CodeIgniter. In that case you'd either need to have 2 instances of CI and protect the directory your admin version sits in... or you'd need to use an auth library. Having 2 copies of CI seems like a really bad idea. Just try walmeister's auth library.
#8

[eluser]mikka23[/eluser]
Thanks for the help. I managed to get it working with dx_auth. I tried waldmeister's but couldn't work it.




Theme © iAndrew 2016 - Forum software by © MyBB