From: Stricted Date: Tue, 17 Feb 2015 06:18:39 +0000 (+0100) Subject: add domain add template X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19da48712cae6031fbc11ffdccaa7211adbfa2c2;p=GitHub%2FStricted%2FDomain-Control-Panel.git add domain add template --- diff --git a/lib/page/DomainAddPage.class.php b/lib/page/DomainAddPage.class.php index 5ada3b8..a038bb1 100644 --- a/lib/page/DomainAddPage.class.php +++ b/lib/page/DomainAddPage.class.php @@ -14,7 +14,7 @@ class DomainAddPage extends AbstractPage { 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."."; } @@ -57,9 +57,10 @@ class DomainAddPage extends AbstractPage { 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 { diff --git a/lib/page/RecordAddPage.class.php b/lib/page/RecordAddPage.class.php index 778ef13..326dd08 100644 --- a/lib/page/RecordAddPage.class.php +++ b/lib/page/RecordAddPage.class.php @@ -123,6 +123,7 @@ class RecordAddPage extends AbstractPage { $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") { diff --git a/lib/page/RecordEditPage.class.php b/lib/page/RecordEditPage.class.php index 94c08f5..4a2caf6 100644 --- a/lib/page/RecordEditPage.class.php +++ b/lib/page/RecordEditPage.class.php @@ -156,6 +156,7 @@ class RecordEditPage extends AbstractPage { } 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") { diff --git a/templates/default/domainAdd.tpl b/templates/default/domainAdd.tpl new file mode 100644 index 0000000..201024f --- /dev/null +++ b/templates/default/domainAdd.tpl @@ -0,0 +1,40 @@ +{include file="header.tpl"} +
+ +
+{if isset($success)} +
+ Domain erfolgreich hinzugefügt. +
+{/if} +
+
+
+
+
Domain hinzufügen
+
+
+
+
+
+ + + {if $error=='origin'}Please correct the error{/if} + +
+
+
+
+
+
+
+
+ +
+
+{include file="footer.tpl"} \ No newline at end of file diff --git a/templates/default/recordAdd.tpl b/templates/default/recordAdd.tpl index 2301345..09c5650 100644 --- a/templates/default/recordAdd.tpl +++ b/templates/default/recordAdd.tpl @@ -14,6 +14,11 @@ +{if isset($success)} +
+ Record erfolgreich hinzugefügt. +
+{/if}
diff --git a/templates/default/recordEdit.tpl b/templates/default/recordEdit.tpl index 4b212b3..7c235ac 100644 --- a/templates/default/recordEdit.tpl +++ b/templates/default/recordEdit.tpl @@ -14,6 +14,11 @@
+{if isset($success)} +
+ Record erfolgreich bearbeitet. +
+{/if}