public function prepare() {
if (isset($_POST['origin']) && isset($_POST['submit'])) {
if (!empty($_POST['origin'])) {
- $origin = $_REQUEST['origin'];
+ $origin = $_POST['origin'];
if (substr($origin, -1) != ".") {
$origin = $origin.".";
}
DNS::getDB()->query($sql, $rrData);
}
}
+ DNS::getTPL()->assign(array("error" => '', 'success' => true));
}
else {
- DNS::getTPL()->assign(array("error" => 'origin'));
+ DNS::getTPL()->assign(array("error" => 'origin', 'origin' => $_POST['origin']));
}
}
else {
$sql = "UPDATE dns_soa SET serial = ? WHERE id = ?";
DNS::getDB()->query($sql, array($this->fixSerial($soa['serial']), $soa['id']));
+ DNS::getTPL()->assign(array('success' => true));
}
else {
if ($type == "SRV" || $type == "DS" || $type == "TLSA") {
}
DNS::getTPL()->assign(array('name' => $name, 'type' => $type, 'weight' => $weight, 'port' => $port, 'data' => $data, 'aux' => $aux, 'ttl' => $ttl));
+ DNS::getTPL()->assign(array('success' => true));
}
else {
if ($type == "SRV" || $type == "DS" || $type == "TLSA") {
--- /dev/null
+{include file="header.tpl"}
+<div class="row">
+ <div class="col-lg-12">
+ <ol class="breadcrumb">
+ <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="index.php?page=DomainAdd">Domain hinzufügen</a></li>
+ </ol>
+ </div>
+</div>
+{if isset($success)}
+ <div class="alert alert-success">
+ Domain erfolgreich hinzugefügt.
+ </div>
+{/if}
+<form method="post" action="index.php?page=DomainAdd">
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="panel panel-default">
+ <div class="panel-heading">Domain hinzufügen</div>
+ <div class="panel-body">
+ <div class="dataTable_wrapper">
+ <fieldset>
+ <dl>
+ <dt><label for="origin">Name</label></dt>
+ <dd{if $error=='origin'} class="form-group has-error"{/if}>
+ <input type="text" id="origin" name="origin" value="{if isset($origin)}{$origin}{/if}" maxlength="255" class="form-control medium">
+ {if $error=='origin'}<span class="help-block">Please correct the error</span>{/if}
+ </dd>
+ </dl>
+ </fieldset>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="formSubmit" style="text-align: center;">
+ <input class="btn btn-gr-gray" name="submit" type="submit" value="Submit" >
+ </div>
+</form>
+{include file="footer.tpl"}
\ No newline at end of file
</div>
</div>
</div>
+{if isset($success)}
+ <div class="alert alert-success">
+ Record erfolgreich hinzugefügt.
+ </div>
+{/if}
<form method="post" action="index.php?page=RecordAdd&id={$soa['id']}">
<div class="row">
<div class="col-lg-12">
</div>
</div>
</div>
+{if isset($success)}
+ <div class="alert alert-success">
+ Record erfolgreich bearbeitet.
+ </div>
+{/if}
<form method="post" action="index.php?page=RecordEdit&id={$rr['id']}">
<div class="row">
<div class="col-lg-12">