1
0
Fork 0

Domain list

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@26 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2003-12-20 14:23:33 +00:00
parent a35d786f5b
commit 2b0cbdf707
4 changed files with 64 additions and 1 deletions

View file

@ -1,2 +1,32 @@
<?php
require("wantauth.php");
require("tools.php");
session_start();
include("userhead.php");
include("domainstatustypes.php");
?>
<div>
<?php
$dbh=db_open();
$query=sprintf("SELECT * FROM domain WHERE client=%d",
$_SESSION["client"]);
$result=pg_query($dbh, $query);
$rows=pg_num_rows($result);
if ($rows==0) {
print("<p>" . _("You don't have any domains registered.") . "</p>");
}
else {
print("<p>" . _("Here is a list of your currently registered domains.") . "</p>");
printf("<table><tr><th>%s</th><th>%s</th></tr>",
_("Domain name"), _("Status"));
while ($row=pg_fetch_array($result)) {
printf("<tr><td>%s</td><td>%s</td></tr>",
$row["domainname"], get_domainstatustype_name($row["status"]));
}
print("</table>");
}
db_close($dbh);
?>
</div>
<a href="registerdomain.php"><?php print(_("Add domain")); ?></a>

26
php/domainstatustypes.php Normal file
View file

@ -0,0 +1,26 @@
<?php
define("cDOMPENDING", 1);
define("cDOMREG", 2);
define("cDOMCON", 4);
define("cDOMKK", 8);
function get_domainstatustype_name($typenum) {
switch ($typenum) {
case cDOMPENDING:
return _("pending");
break;
case cDOMREG:
return _("registered");
break;
case cDOMCON:
return _("connected");
break;
case cDOMKK:
return _("in transfer");
break;
default:
return _("Unknown domain status");
}
}
?>

6
php/registerdomain.php Normal file
View file

@ -0,0 +1,6 @@
<?php
require("wantauth.php");
require("tools.php");
session_start();
include("userhead.php");
?>

View file

@ -17,6 +17,7 @@ printf(_("Logged in as %s (%s)"), $row["name"],
get_usertype_name($row["type"]));
print("<br/>");
$_SESSION["client"]=$row["client"];
$query=sprintf("SELECT client.*, country.name AS cname FROM client, country WHERE client.id=%d AND country.id=client.country", $row["client"]);
$result=pg_query($dbh, $query);