RE: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-28 Thread JD Daniels

That is where I got the class originally...

The url for the guys who wrote the class is here:

http://www.thewebmasters.net/

They have a link right on the front page.
There are actually two classes.. htgroup and htpasswd... I have put them
into one file for my own use.

Sorry to everyone for the confusion.

JD

-Original Message-
From: Caleb Walker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 6:56 PM
To: JD Daniels; Samuel Torton
Cc: php
Subject: Re: [PHP-DB] 'htaccess method : how to modify passwords from
PHP scripts ?


On Tuesday 24 July 2001 10:22 am, JD Daniels wrote:
 There is a fantastic class that takes care of writing .ht* files... look
 here:

 http://phpclasses.upperdesign.com/

Couldnt find anything on writing .ht* files.  Are you sure?


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-26 Thread Samuel Torton

Hi,


Thank you to everybody who answered my question.
Unfortunately, I don't use classes in my php.
Here is the solution I actually used :


--
--
// Generate new line for username + modified password
$line = read_cgi(username).:.crypt(read_cgi(password)).\n;

// opens a temp file
$pass_file_tmp = fopen(PASS_FILE_TMP,a);

// reads actual password file
$fcontents = file(PASS_FILE);
while ( list( $numero_ligne, $ligne ) = each( $fcontents ) )
{
  if (!ereg(read_cgi(username),$ligne))
  {
fwrite($pass_file_tmp,$ligne);
  }
}

// add new password of the selected user
fwrite($pass_file_tmp,$line);

// deletes the old passwd file and replaced by the new one
rename(PASS_FILE_TMP,PASS_FILE);
--
--


Regards,

--
Samuel Torton
NCSLab.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-25 Thread Caleb Walker

On Tuesday 24 July 2001 10:22 am, JD Daniels wrote:
 There is a fantastic class that takes care of writing .ht* files... look
 here:

 http://phpclasses.upperdesign.com/

Couldnt find anything on writing .ht* files.  Are you sure?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-25 Thread Jordan

  There is a fantastic class that takes care of writing .ht* files... look
  here:
 
  http://phpclasses.upperdesign.com/
 
 Couldnt find anything on writing .ht* files.  Are you sure?

I looked and originally had trouble finding the class there too.
I think it is a mirror of a version of the following class:

http://www.thewebmasters.net/php/Htpasswd.phtml

I haven't had a chance to test it out, but I think this might be what you are looking 
for.

Cheers.

--JW


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]