|
-
Mar 21st, 2006, 08:13 PM
#1
Thread Starter
Lively Member
HTTP Auth woes
Hi,
I've installed PHPWiki and my authentication doesn't work.
It simply rejects my correct username/password.
Here's the auth code. It seems fine to me.
Code:
// Set these to your preferences.
// For heaven's sake pick a good password!
$wikiadmin = "myuser";
$adminpasswd = "mypass";
// Do not tolerate sloppy systems administration
if (empty($wikiadmin) || empty($adminpasswd)) {
echo gettext("Set the administrator account and password first.\n");
exit;
}
// From the manual, Chapter 16
if (($_SERVER['PHP_AUTH_USER'] != $wikiadmin ) ||
($_SERVER['PHP_AUTH_PW'] != $adminpasswd)) {
Header("HTTP/1.0 401 Unauthorized");
Header("WWW-Authenticate: Basic realm=\"PhpWiki\"");
echo gettext("You entered an invalid login or password."
exit;
}
Naughty but Nice 
-
Mar 21st, 2006, 08:16 PM
#2
<?="Moderator"?>
Re: HTTP Auth woes
What server is it hosted on, because IIS doesn't like HTT Auth from PHP. If it is IIS then it can be configured to allow this. Gimmie a sec and I'll dig out the link.
-
Mar 21st, 2006, 08:31 PM
#3
Thread Starter
Lively Member
Re: HTTP Auth woes
Thanks for your help.
I'm on:
Apache 1.3.34 (Unix): PHP v4.4.1 (suExec enabled)
MySQL v4.0.25-standard.
It's not my server. I'm paying for some server space.
The php script was in fact provided by my ISP. It installs automatically (i provide a couple of basic settings and the rest is automated.)
I'll ask my ISP if all else fails.
Thanks
Naughty but Nice 
-
Mar 21st, 2006, 08:40 PM
#4
<?="Moderator"?>
Re: HTTP Auth woes
Your code seem valid, and nothings wrong with it. Have you tried printing out the values $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] when it failed to see if the information was sent correctly or at all?
-
Mar 21st, 2006, 08:53 PM
#5
Thread Starter
Lively Member
Re: HTTP Auth woes
Yeah, they seem to be blank. So the message isn't getting through.
Any ideas?
I've tried firefox and IE by the way. same problem.
Naughty but Nice 
-
Mar 21st, 2006, 08:57 PM
#6
<?="Moderator"?>
Re: HTTP Auth woes
Hmm try contacting your host because as far as i can tell it appear to be a problem with your host. They might be able to shed some more light on the situtation.
Last edited by john tindell; Mar 21st, 2006 at 08:57 PM.
Reason: Bad spelling :eek2:
-
Mar 21st, 2006, 08:59 PM
#7
Thread Starter
Lively Member
Re: HTTP Auth woes
Ok will do.
Thanks very much for your help.
Naughty but Nice 
-
Mar 21st, 2006, 09:00 PM
#8
<?="Moderator"?>
Re: HTTP Auth woes
No worries, Can you please mark the thread as resolved
-
Mar 22nd, 2006, 02:15 AM
#9
Conquistador
Re: HTTP Auth woes
If php's set up as a cgi, then the apache authentication hooks don't work.
You'd need to speak to your host to investigate that / to change it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|