'htaccess" method : how to modify passwords from PHP scripts ?

From: Date: Tue, 24 Jul 2001 13:39:37 +0000
Subject: 'htaccess" method : how to modify passwords from PHP scripts ?
Groups: php.db 
Request: Send a blank email to php-db+get-10706@lists.php.net to get a copy of this message
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

« previous php.db (#10706) next »