Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 mod_auth_digest
Google
Post new topic Reply to topic
Author Message
x81kilo
 
 


Joined: 11 Dec 2003
Posts: 17

PostPosted: Mon Jul 26, 2004 5:25 am Reply with quoteBack to top

mancini, does using mod_auth_digest help me any in my efforts to automate creation of the .htpasswd ? meaning I last posted that I was attempting to use perl or php scripts to automatically add username/pass from a webpage, it appends everything ok to the .htaccess/.htpasswd files no problem, problem was when I tried the password, wouldnt work, unless i wiped out the "encrypted" password from the .htaccess file and typed it in clear text (which is not what i want to do) - running win2k box.

Cant boast enough about you here... Razz wish I had you as a neighbor !!
Twisted Evil
x81kilo
View user's profileSend private message
caperneoignis
 
 


Joined: 14 Jul 2004
Posts: 27
Location: Good `ol Georgia

PostPosted: Mon Jul 26, 2004 4:19 pm Reply with quoteBack to top

I know this was direct to marchi(sorry if i misspelled). did you make sure the hashing is correct when you entered the password i know you said it inserted it. But from what i understand is if your program doesnt use the right type of crypt key the program that will be using it wont know what it is/understand/decrypt it.
any way im just trying to help so if im wrong sorry but thats how i understood it. (also if i am can you post what i am suppoced to do Cool ) i like to know things.
sincerly
caper
View user's profileSend private messageSend e-mailAIM Address
x81kilo
 
 


Joined: 11 Dec 2003
Posts: 17

PostPosted: Mon Jul 26, 2004 10:38 pm Reply with quoteBack to top

ok, here is my php files in zip format

my path to multiple domains is:

c:/apache2traid/htdocs/domains (this dir contains tester.com as test domain)

so....

c:/apache2traid/htdocs/domains/tester.com
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Tue Jul 27, 2004 6:11 am Reply with quoteBack to top

the problem with your script is that you don't understand how to use crypt() to generate a htpasswd hash

you use : $pwd=crypt($par[password1]);

according to http://php.net/crypt for the generated password to be the same as the output of
Quote:
htpasswd_exe -b htpasswd_file user password

apache htpasswd file, you'll need to use the first two letters of the password as the salt.

should use :
Code:
<?php
$pwd = crypt($password, substr($password, 0, 2));
?>


and this is in theory

the actual fact is that the format of the htpassswd output is furthermore different and that is why we use in our scripts

Quote:
system("$htpasswd_exe -b $htpasswd_file root $hpassword");


and that is what i recomend

other than that feel free to use mod_auth_digest in exchange for this , but it might be a little more complicated
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT