2003-11-23 21:44:06 +01:00
|
|
|
<?php
|
|
|
|
require("wantauth.php");
|
|
|
|
require("tools.php");
|
|
|
|
|
|
|
|
$dbh = db_open();
|
2004-03-08 18:42:14 +01:00
|
|
|
|
2003-11-23 21:44:06 +01:00
|
|
|
$username = strtolower(substr(trim($_SERVER['PHP_AUTH_USER']), 0, 12));
|
|
|
|
$password = md5(substr(trim($_SERVER['PHP_AUTH_PW']), 0, 30));
|
|
|
|
$query = "SELECT * FROM sysuser WHERE name='$username' AND md5pass='$password'";
|
|
|
|
//echo $query;
|
2004-03-08 18:42:14 +01:00
|
|
|
$result = db_query($dbh, $query) or die("query failed");
|
2003-11-23 21:44:06 +01:00
|
|
|
|
|
|
|
if (pg_num_rows($result) == 0) {
|
|
|
|
$logged_in = false;
|
|
|
|
authenticate();
|
|
|
|
echo $_SERVER['PHP_AUTH_USER'];
|
|
|
|
echo "NOT LOGGED IN<br/>";
|
|
|
|
} else {
|
|
|
|
$logged_in = true;
|
|
|
|
session_start();
|
|
|
|
$row=pg_fetch_array($result);
|
|
|
|
$_SESSION["userid"]=$row["id"];
|
|
|
|
}
|
|
|
|
|
2003-12-20 15:36:28 +01:00
|
|
|
include("commonhead.php");
|
2003-11-23 21:44:06 +01:00
|
|
|
?>
|
2003-12-20 15:36:28 +01:00
|
|
|
<div>
|
2003-11-23 21:44:06 +01:00
|
|
|
<?php
|
|
|
|
if (! $logged_in) {
|
2003-12-20 15:36:28 +01:00
|
|
|
print("<p>" . _("You're not known to the system.") . "<br/>");
|
|
|
|
print(_("Please go back and try again.") . "</p>");
|
2003-11-23 21:44:06 +01:00
|
|
|
} else {
|
2003-12-20 14:47:49 +01:00
|
|
|
include("userhead.php");
|
|
|
|
// echo _("Session with ID: ").session_id()."<br/>";
|
|
|
|
// echo _("UID: ").$_SESSION["userid"]."<br/>";
|
2003-12-20 15:36:28 +01:00
|
|
|
print("<p>");
|
2003-11-23 21:44:06 +01:00
|
|
|
printf(_("You may now see your <a href=\"%s\">Domain list</a>."),
|
|
|
|
"domainlist.php");
|
2003-12-20 15:36:28 +01:00
|
|
|
print("</p>");
|
2003-11-23 21:44:06 +01:00
|
|
|
}
|
|
|
|
?>
|
2003-12-20 15:36:28 +01:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
include("commonfoot.php");
|
|
|
|
?>
|