add domain add template
authorStricted <info@stricted.de>
Tue, 17 Feb 2015 06:18:39 +0000 (07:18 +0100)
committerStricted <info@stricted.de>
Tue, 17 Feb 2015 06:18:39 +0000 (07:18 +0100)
lib/page/DomainAddPage.class.php
lib/page/RecordAddPage.class.php
lib/page/RecordEditPage.class.php
templates/default/domainAdd.tpl [new file with mode: 0644]
templates/default/recordAdd.tpl
templates/default/recordEdit.tpl

index 5ada3b801777100a8990334eed1c95e4609322e3..a038bb19e16cd7b872dbf637367f2d1b7ec9f684 100644 (file)
@@ -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 {
index 778ef13463b9787cbb08b7a1e4beb7bf763275fd..326dd0838b6c6663899619ad89d4ac8a34ed1bb8 100644 (file)
@@ -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") {
index 94c08f56d66d875336db65c0da6088f6315452b2..4a2caf655251cc5372ec9ab2dd1a41abd70343d7 100644 (file)
@@ -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 (file)
index 0000000..201024f
--- /dev/null
@@ -0,0 +1,40 @@
+{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
index 23013459c06995d0504016f98af0ba1ac22b646a..09c5650246a9bc91da061c7f7d107e075353784b 100644 (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">
index 4b212b3690bce4e954b7c76cfe594fd16f20bf7f..7c235acc5a670d31e1d35f72f3a84a16ad3507b0 100644 (file)
                </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">