stevenc317
asked on
.htpassswd and perl
Hi,
I have just setup a .htpasswd password thing on one of the directories of my web page. I would like to have a perl script that would create user names and passwords. I think the easiest way for it to work, would be to have it run some UNIX comands. But I do not know how to get it to do that. Because when you are adding a user it asks for the password twice. Here is the commands that I use (when in my telnet app).
cd htdocs
cd login
htpasswd .htpasswd USER NAME
then asks for password twice so I type it in twice. That is what I can't figure out how to do. I know it can be done cause experts-exchange uses it for their member system.
thanks!!
I have just setup a .htpasswd password thing on one of the directories of my web page. I would like to have a perl script that would create user names and passwords. I think the easiest way for it to work, would be to have it run some UNIX comands. But I do not know how to get it to do that. Because when you are adding a user it asks for the password twice. Here is the commands that I use (when in my telnet app).
cd htdocs
cd login
htpasswd .htpasswd USER NAME
then asks for password twice so I type it in twice. That is what I can't figure out how to do. I know it can be done cause experts-exchange uses it for their member system.
thanks!!
http://www.perl.com/CPAN/modules/by-module/HTTPD
ASKER
ozo what do i do when I get there? It sends me to a ftp site.
You might try downloading the HTTPD-Tools-0.55.tar.gz file there,
and seeing if the HTTPD module for managing ccess control files does what you want.
(unless you can tell by the HTTPD-Tools-0.55.readme that it does not,
in which case you might clarify your question)
On the second part of your question, try looking at $ENV{'REMOTE_USER'}
and seeing if the HTTPD module for managing ccess control files does what you want.
(unless you can tell by the HTTPD-Tools-0.55.readme that it does not,
in which case you might clarify your question)
On the second part of your question, try looking at $ENV{'REMOTE_USER'}
ASKER
Ok the second part works, THANKS!!! I will check out that page now! If you would like to see the second thing in action please go to html.tou.com/ (for sign up for a login id).
thanks
SO MUCH!!!
thanks
SO MUCH!!!
ASKER
I can't get the fiel to install, have an other ideas?
What problems did you have intalling?
Did you report the problem as instructed?
Did you report the problem as instructed?
ASKER
I typed in make (the command they say to use) and it came up with an error. and no i did not report it.
ASKER
Edited text of question
What errors did it come up with?
To do a telnet from perl, see
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/Can_I_use_perl_to_run_a_telnet_o.html
http://www.perl.com/CPAN/doc/wwwman/libnet/Net/Telnet.html
http://www.perl.com/CPAN/authors/id/JROGERS/Net-Telnet-3.00.readme
To run interactive user commands, see
http://www.perl.com/CPAN/authors/id/ERICA/Comm.pl-1.8.tar.gz
BTW, I can't seem to find your other question, qid=8630023345 "HELP"
about $member eq 'webmaster'
To do a telnet from perl, see
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/Can_I_use_perl_to_run_a_telnet_o.html
http://www.perl.com/CPAN/doc/wwwman/libnet/Net/Telnet.html
http://www.perl.com/CPAN/authors/id/JROGERS/Net-Telnet-3.00.readme
To run interactive user commands, see
http://www.perl.com/CPAN/authors/id/ERICA/Comm.pl-1.8.tar.gz
BTW, I can't seem to find your other question, qid=8630023345 "HELP"
about $member eq 'webmaster'
ASKER
I will look into those pages!
Sorry bout that, I deleted it. Since you answered my question there was no need to leave it up. If you just wanted to see what is said, I said thanks.
Sorry bout that, I deleted it. Since you answered my question there was no need to leave it up. If you just wanted to see what is said, I said thanks.
I think the idea of this site is to grade the best answers and leave
them with previously asked questions for others to benefit from.
(but I suppose it was too specific a question to be of much general interest)
them with previously asked questions for others to benefit from.
(but I suppose it was too specific a question to be of much general interest)
ASKER
Well I usually do that, but your answer worked perfectly!
That's a switch, most people want to delete the useless answers :-)
ASKER
<g>
ASKER
http://www.perl.com/CPAN/authors/id/JROGERS/Net-Telnet-3.00.readme
looks good, but I alwasy have trouble installing things like that. With the make commands. In what directory should I install it from? I have tried in the home dir (i think it is called that, it is the directory that comes up when I login).
can u please tell me where to install that thing?
looks good, but I alwasy have trouble installing things like that. With the make commands. In what directory should I install it from? I have tried in the home dir (i think it is called that, it is the directory that comes up when I login).
can u please tell me where to install that thing?
ASKER
Edited text of question
On question 8630023522, I meant to say you could add diagnostics like
|| die "Can't open logfile.txt because $!";
and
print "Mail status: $?\n";
at the end of the existing
open(TLOG, "logfile.txt")
and
close MAIL;
statements, not that you should add them as completly new lines.
And when called through cgi, the error messages will go to the
server error log, and not back to the browser.
|| die "Can't open logfile.txt because $!";
and
print "Mail status: $?\n";
at the end of the existing
open(TLOG, "logfile.txt")
and
close MAIL;
statements, not that you should add them as completly new lines.
And when called through cgi, the error messages will go to the
server error log, and not back to the browser.
ASKER
thanks for answering that question, sorry i can't give you the credits (cause I ened this question answered). I just put a new question up (I think i called it Mail ...) it should be at the top. If you can answer that one I will give you the 45 points. (sorry all i have).
thanks!
thanks!
Also, given your
# read in templog
open(TLOG, "logfile.txt");
while (<TLOG>) {
$sendThis .= $_;
}
close TLOG;
It seems redundant to have
# clear templog
rename("logfile.txt","logf ile.$$");
open(TLOG,"logfile.$$");
{local $/=undef;$SendThis=<TLOG>}
close TLOG;
unlink "logfile.$$";
I think the latter was meant to replace the former
# read in templog
open(TLOG, "logfile.txt");
while (<TLOG>) {
$sendThis .= $_;
}
close TLOG;
It seems redundant to have
# clear templog
rename("logfile.txt","logf
open(TLOG,"logfile.$$");
{local $/=undef;$SendThis=<TLOG>}
close TLOG;
unlink "logfile.$$";
I think the latter was meant to replace the former
ASKER
what do u mean?
Why not use normal server tools? Even FastTrack lets you control access?
ASKER
I want it to be in perl, sorry but that is how i want it done.
thanks anyway,
Steven
thanks anyway,
Steven
You may separately ask for the same password twice with
java script on the www page, and only submit, if it's the
same, and then put it with perl into a database. And perl
has the crypt command to use as: crypt(passwd,salt); But maybe
I did not propperly understand the question....
java script on the www page, and only submit, if it's the
same, and then put it with perl into a database. And perl
has the crypt command to use as: crypt(passwd,salt); But maybe
I did not propperly understand the question....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.