View Single Post
Old 4th November 2005, 10:47
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts

No that doesn't work. Have a look here:

It reads:
The AuthUserFile directive sets the name of a textual file containing the list of users and passwords for user authentication. File-path is the path to the user file. If it is not absolute (i.e., if it doesn't begin with a slash), it is treated as relative to the ServerRoot.

Each line of the user file contains a username followed by a colon, followed by the crypt() encrypted password. The behavior of multiple occurrences of the same user is undefined.
But you can do authentication with PHP, without .htaccess. It works like this:

PHP Code:
// checks if you have entered a username and a password
// if empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="Admin"');
header('HTTP/1.0 401 Unauthorized');
"Authorization Required.";
// check if the username and password are correct
if (($_SERVER['PHP_AUTH_USER'] == "demo") && ($_SERVER['PHP_AUTH_PW'] == "demo"))
// dispay happy message and admin stuff
echo "Welcome!";
// display angry message for invalid user
die("Oops! That didn't work...");
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!


nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote