OK, I am asking something specific:
1) I know that I can get away with a system() call to htpasswd command to add another user, but I think this is not that elegant. I am looking for some way to crypt the password so it would be stored in a .htpasswd file. Any suggestions or tutorials??
2) Is the split() function a good way to search for a username in the .htpasswd file?? Something like:
foreach $line (<FILE> ){
($user, $pass) = split(/:/,$line);
if ($user == $q->param("username")){
$found=1;
last;
}else{
$found = 0;
}
}
Hoping for an answer...  |