add domain
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@31 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
283f07fbe1
commit
dbae3c8bd3
5 changed files with 43 additions and 19 deletions
|
@ -1,7 +1,43 @@
|
|||
<?php
|
||||
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);
|
||||
}
|
||||
|
||||
require("wantauth.php");
|
||||
require("tools.php");
|
||||
session_start();
|
||||
|
||||
include("userhead.php");
|
||||
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;
|
||||
}
|
||||
include("commonfoot.php");
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue