1
0
Fork 0
gnuviechadmin-historic/php/start.php

45 lines
1.1 KiB
PHP
Raw Normal View History

<?php
require("wantauth.php");
require("tools.php");
$dbh = db_open();
$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;
$result = db_query($dbh, $query) or die("query failed");
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"];
}
include("commonhead.php");
?>
<div>
<?php
if (! $logged_in) {
print("<p>" . _("You're not known to the system.") . "<br/>");
print(_("Please go back and try again.") . "</p>");
} else {
include("userhead.php");
// echo _("Session with ID: ").session_id()."<br/>";
// echo _("UID: ").$_SESSION["userid"]."<br/>";
print("<p>");
printf(_("You may now see your <a href=\"%s\">Domain list</a>."),
"domainlist.php");
print("</p>");
}
?>
</div>
<?php
include("commonfoot.php");
?>