RE: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?
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 ?
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 ?
> > 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]
RE: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?
http://www.zend.com/codex.php?CID=246 there's a couple there, i think there's also one on phpBuilder.com // -Original Message- // From: Caleb Walker [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 26 July 2001 9:56 AM // 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] // -- 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 ?
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 ?
There is a fantastic class that takes care of writing .ht* files... look here: http://phpclasses.upperdesign.com/ -Original Message- From: Samuel Torton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 6:40 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ? Hi all, I use a Linux platform, Apache, and PHP4. I use "htaccess" method in order to have restricted accesses, and I handle my users via a PHP interface. - when I want to create a new user, I generate a string such as "username:cryptedpassword", and I insert it at the end of my ".htpasswd" file. - when I want to modify the password of an existing user, how to do that ? --> 1/ delete the line corresponding to this user, and then insert the new "username:cryptedpassword" line ? in this case, can you tell me which funtions to use (find a line in an ascii file, delete it, and insert the new one) ? --> 2/ run a command line such as "htpasswd ..." (without "-c" argument) ? in this case, can you tell me how to run a unix command line from a PHP script ? Thanks a lot in advance. 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] -- 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]