CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Additional .htaccess authentication

 



d1zz13
User

Apr 6, 2002, 4:41 PM

Post #1 of 5 (921 views)
Additional .htaccess authentication Can't Post

Hi There,

I'm using a free script from the perl archive that sets up the .htaccess and .htpasswd files on my server. It also allows me to add new users, delete existing users, and change passwords. This is ideal as it means that my directory is new secure with little, in fact no scripting on my part.

However, now when people try to access the directory they get the standard login prompt which is very unsightly. Is there a way for me to create my own html login page that calls a script to authorize a user based on the details in the .htpasswd file?

I'm sure this is possible as the original script allows me change passwords so it must be interacting with the .htpasswd somehow.

Any help would be much appreciated.

Regards
Richard


PerlJam
Novice

Apr 8, 2002, 2:13 PM

Post #2 of 5 (914 views)
Re: [d1zz13] Additional .htaccess authentication [In reply to] Can't Post

You could but it might be more of a hassel than anything..
What do you find so unsightly about the windows box that pops up for your username and password ? It works great! if you changed it you would have to get ride of .htaccess file in each dir.


d1zz13
User

Apr 8, 2002, 6:46 PM

Post #3 of 5 (909 views)
Re: [PerlJam] Additional .htaccess authentication [In reply to] Can't Post

It's not that it's unsightly really. I just need to add a cookie to the browser when the user logs in. The easiest way I thought of doing it was just add it to the end of a login script, the only problem is that my client is using .htaccess.

So I need a way to add a cookie to the browser upon login.

Any ideas?

Regards
Richard

Regards
Rich

If it aint broke then don't try to fix it


PerlJam
Novice

Apr 9, 2002, 10:11 PM

Post #4 of 5 (903 views)
Re: [d1zz13] Additional .htaccess authentication [In reply to] Can't Post

what do you want to be able to set into the cookie ? The username and pass ?
Or something else.. If its something else .. Maybe an SSI tag on your index page might load it in ?

If you want to set the username and pass htaccess already allows you to save the password to your password list.


d1zz13
User

Apr 10, 2002, 4:46 AM

Post #5 of 5 (901 views)
Re: [PerlJam] Additional .htaccess authentication [In reply to] Can't Post

Thanks for taking the time to reply PerlJam.

I only want one person to be able to log in with the same username at any one time. So the plan was to call a script on login that basically checked to see if they were in the "logged in" list, and if not then add them.

This isn't a problem. The problem is making sure that they log out, at which point their name is deleted from the list, enabling them to log in again next time.

The idea was to add a cookie to the browser with a name of LOGGEDIN and a value of TRUE when they log in. So that on leaving the site another script could just see if the cookie was present and if so delete it and the name from the list.

This isn't too much of a problem either. The problem lies with my client using .htaccess to authorize his users. I don't want them to have to log in with the stupid windows standard box and then log in via one of my scripts as well.

Sorry its a bit long winded.
Regards and TIA
Richard

Regards
Rich

If it aint broke then don't try to fix it

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives