2003-12-20 15:23:33 +01:00
|
|
|
<?php
|
2004-03-08 18:42:14 +01:00
|
|
|
require_once("tools.php");
|
|
|
|
require_once("usertypes.php");
|
|
|
|
$dbh = db_open();
|
|
|
|
|
|
|
|
function add_domain() {
|
|
|
|
global $dbh;
|
|
|
|
$query = sprintf("INSERT INTO domain (domainname, client) VALUES ('%s', %d)",
|
|
|
|
$_POST["domainname"],
|
|
|
|
$_SESSION["client"]);
|
|
|
|
db_exec($dbh, $query);
|
|
|
|
}
|
|
|
|
|
2003-12-20 15:23:33 +01:00
|
|
|
require("wantauth.php");
|
|
|
|
session_start();
|
2004-03-08 18:42:14 +01:00
|
|
|
|
2003-12-20 15:23:33 +01:00
|
|
|
include("userhead.php");
|
2004-03-08 18:42:14 +01:00
|
|
|
if (!isset($_POST["mode"])) {
|
|
|
|
$mode = "step1";
|
|
|
|
} else {
|
|
|
|
$mode = $_POST["mode"];
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($mode) {
|
|
|
|
case "step1" :
|
|
|
|
?>
|
|
|
|
<p><?php print(_("Add new domain")); ?></p>
|
|
|
|
<form action="<?php echo $PHP_SELF; ?>" method="post">
|
|
|
|
<input type="hidden" name="mode" value="commit">
|
|
|
|
<table>
|
|
|
|
<tr><td><?php print(_("Domain name:")); ?></td><td><input type="text" name="domainname"></td></tr>
|
|
|
|
<tr><td colspan="2" align="right"><input type="submit" name="submit" value="<?php print(_("add")); ?>"</td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
case "commit" :
|
|
|
|
add_domain();
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2003-12-20 15:36:28 +01:00
|
|
|
include("commonfoot.php");
|
2003-12-20 15:23:33 +01:00
|
|
|
?>
|