Your looking for this:
$_SERVER['PHP_AUTH_USER']
When running under Apache as module doing HTTP authentication this
variable is set to the username provided by the user.
See Reserved Variables: http://www.php.net/reserved.variables
Jami Moore
LightSPARK Digital Designs
Check out :
Authenticating against .htpasswd style files.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=109
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-Original Message-
From: Rob Packer [mailto:[EMAIL
[EMAIL PROTECTED]
To: Kris [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 12:37 AM
Subject: Re: [PHP] htpasswd
Don't chmod .htpasswd- _huge_ security risk... Will your server allow you
to
have suid scripts??? If so, you can just write a little wrapper and make
it
suid
Don't chmod .htpasswd- _huge_ security risk... Will your server allow you to
have suid scripts??? If so, you can just write a little wrapper and make it
suid. If you do that, I'd also reccomend using an extension other than PHP,
and/or placing it outside your web root. Wouldn't want people
%htpasswd --help
Usage:
htpasswd [-cmdps] passwordfile username
htpasswd -b[cmdps] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force
go to http://www.php.net/manual/en/ref.filesystem.php and read up on things
like fopen, fclose, etc. This will explain how to write to any kind of file
including htpasswd files if necessary.
Good Luck
Derek
- Original Message -
From: Gary [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent:
Brandon Orther wrote:
Hello,
I am trying to make a script that creates .htpasswd files. Does anyone
know what encryption is used?
Thanks
Brandon
It can be crypt() or MD5 or SHA, you could call htpasswd.
See man htpasswd under *nix.
--
PHP General Mailing List (http://www.php.net/)
At 04:39 PM 4/9/2001, Brandon Orther wrote:
i believe that the scheme is md5
~kurth
Hello,
I am trying to make a script that creates .htpasswd files. Does anyone know
what encryption is used?
Thanks
Brandon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
It can really depend on your system.
On mine, for instance, it uses regular crypt() with a 2 character salt
So, you can generate a random 2 character string to pass as the salt
argument in php, and create it that way.
IF that is the method used by your system
Wanna test it?
Peek inside
Yes, you can, just write a script to call "htpasswd -b yourUserFile userID
passwd".
:)
David
From: James Smith [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: [PHP] .htpasswd?
Date: Wed, 31 Jan 2001 13:21:35 -0800 (PST)
Is there a way that when a user signs up for a
10 matches
Mail list logo