Ok i just can't fugure it out.
Now i have this in my .htaccess:
AuthType Basic
AuthName "Formula Student Wiki"
AuthUserFile /home/formulas/.htpasswd
#Require valid-user
So no requiring a valid user.
Now i have this in my code:
sub requestLogin
{
if (($ENV{'REMOTE_USER'}) || ($ENV{'AUTH_USER'}))
{
message ('info', "Logged in.");
}
else
{
print <<EOF;
Status: 401 Authorization Required
WWW-Authenticate: Basic realm="Formula Student Wiki"
Connection: close
Content-type: text/plain
Login failed.
EOF
}
}
Now my browser asks me for credentials 3 times, i enter them correctly but it still fails and i get the "Login Failed" message.
Since it's asking 3 times, apache must be doing that so i don't see why it fails. If i uncomment the
require valid-user, everything works.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.