fix templates
authorStricted <info@stricted.de>
Sat, 6 Jun 2015 23:01:32 +0000 (01:01 +0200)
committerStricted <info@stricted.de>
Sat, 6 Jun 2015 23:01:32 +0000 (01:01 +0200)
database.sql
templates/default/recordAdd.tpl
templates/default/recordEdit.tpl

index 868227869600c67bdd1cbb674cadf337533c5fa1..32cf91f5b7d5013ac10abf3cda36e6ef05adc8ad 100644 (file)
@@ -17,13 +17,11 @@ CREATE TABLE IF NOT EXISTS dns_rr (
        id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        zone INT(10) NOT NULL,
        name VARCHAR(255) NOT NULL,
-       --- data VARCHAR(255) NOT NULL,
        data TEXT,
        aux INT(10) NOT NULL,
        ttl INT(10) NOT NULL DEFAULT '86400',
        type enum('A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SRV', 'TXT', 'TLSA', 'NS', 'DS') DEFAULT NULL,
-       active boolean NOT NULL DEFAULT 1,
-       --- UNIQUE KEY dns_rr (zone, name, type, data)
+       active boolean NOT NULL DEFAULT 1
 ) ENGINE=InnoDB;
 
 CREATE TABLE IF NOT EXISTS dns_sec (
@@ -88,7 +86,7 @@ CREATE TABLE IF NOT EXISTS dns_permissions (
 CREATE TABLE IF NOT EXISTS dns_permissions_to_user (
        id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        userID INT(10) NOT NULL,
-       permissionID VARCHAR(255) NOT NULL
+       permissionID INT(10) NOT NULL
 ) ENGINE=InnoDB;
 
 CREATE TABLE IF NOT EXISTS dns_language (
@@ -107,7 +105,7 @@ ALTER TABLE dns_soa_to_user ADD FOREIGN KEY (userID) REFERENCES dns_user (userID
 ALTER TABLE dns_soa_to_user ADD FOREIGN KEY (soaID) REFERENCES dns_soa (id) ON DELETE CASCADE;
 ALTER TABLE dns_template ADD FOREIGN KEY (userID) REFERENCES dns_user (userID) ON DELETE CASCADE;
 ALTER TABLE dns_permissions_to_user ADD FOREIGN KEY (userID) REFERENCES dns_user (userID) ON DELETE CASCADE;
-ALTER TABLE dns_permissions_to_user ADD FOREIGN KEY (permissionID) REFERENCES dns_permissions (id) ON DELETE CASCADE;
+ALTER TABLE dns_permissions_to_user ADD FOREIGN KEY (permissionID) REFERENCES dns_permissions (permissionID) ON DELETE CASCADE;
 
 INSERT INTO dns_options VALUES (1, 'dns_api_key', '0E2372C5-E5A3-424B-82E5-75AD723A9447');
 INSERT INTO dns_options VALUES (2, 'offline', '0');
index 09c5650246a9bc91da061c7f7d107e075353784b..f7b396c6d69dcb739581a7713cd3657730cab8ff 100644 (file)
                                                        <dl>
                                                                <dt>Host</dt>
                                                                <dd {if 'name'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="text" id="name" name="name" value="{if isset($name)}{$name}{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="text" id="name" name="name" value="{if isset($name)}{$name|escape}{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'name'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl>
                                                                <dt>TTL</dt>
                                                                <dd {if 'ttl'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="ttl" name="ttl" value="{if isset($ttl)}{$ttl}{else}60{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="ttl" name="ttl" value="{if isset($ttl)}{$ttl|escape}{else}60{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'ttl'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="aux"{if isset($type) && $type == "SRV" && $type == "DS" && $type == "TLSA" &&  $type == "MX"}{else} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Key-ID{elseif isset($type) && $type == "TLSA"}Usage{else}Prio{/if}</dt>
                                                                <dd {if 'aux'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="aux" name="aux" value="{if isset($aux)}{$aux}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="aux" name="aux" value="{if isset($aux)}{$aux|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'aux'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="weight"{if isset($type) && $type == "SRV" && $type == "DS" && $type == "TLSA"}{else} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Algorithm{elseif isset($type) && $type == "TLSA"}Selector{else}weight{/if}</dt>
                                                                <dd {if 'weight'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="weight" name="weight" value="{if isset($weight)}{$weight}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="weight" name="weight" value="{if isset($weight)}{$weight|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'weight'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="port"{if isset($type) && $type == "SRV" && $type == "DS" && $type == "TLSA"}{else} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Digest Type{elseif isset($type) && $type == "TLSA"}Hash Type{else}port{/if}</dt>
                                                                <dd {if 'port'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="port" name="port" value="{if isset($port)}{$port}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="port" name="port" value="{if isset($port)}{$port|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'port'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="data">
                                                                <dt>{if isset($type) && $type == "DS"}Digest{elseif isset($type) && $type == "TLSA"}Hash{else}Data{/if}</dt>
                                                                <dd {if 'data'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="text" id="data" name="data" value="{if isset($data)}{$data}{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="text" id="data" name="data" value="{if isset($data)}{$data|escape}{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'data'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
index 7c235acc5a670d31e1d35f72f3a84a16ad3507b0..197ecf561fb0d809fc426f4f59c967956e9c7f32 100644 (file)
                                                        <dl>
                                                                <dt>Host</dt>
                                                                <dd {if 'name'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="text" id="name" name="name" value="{if isset($name)}{$name}{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="text" id="name" name="name" value="{if isset($name)}{$name|escape}{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'name'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl>
                                                                <dt>TTL</dt>
                                                                <dd {if 'ttl'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="ttl" name="ttl" value="{if isset($ttl)}{$ttl}{else}60{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="ttl" name="ttl" value="{if isset($ttl)}{$ttl|escape}{else}60{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'ttl'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="aux"{if isset($type) && $type != "SRV" && $type != "DS" && $type != "TLSA" && $type != "MX"} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Key-ID{elseif isset($type) && $type == "TLSA"}Usage{else}Prio{/if}</dt>
                                                                <dd {if 'aux'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="aux" name="aux" value="{if isset($aux)}{$aux}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="aux" name="aux" value="{if isset($aux)}{$aux|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'aux'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="weight"{if isset($type) && $type != "SRV" && $type != "DS" && $type != "TLSA"} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Algorithm{elseif isset($type) && $type == "TLSA"}Selector{else}weight{/if}</dt>
                                                                <dd {if 'weight'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="weight" name="weight" value="{if isset($weight)}{$weight}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="weight" name="weight" value="{if isset($weight)}{$weight|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'weight'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="port"{if isset($type) && $type != "SRV" && $type != "DS" && $type != "TLSA"} style="display: none;"{/if}>
                                                                <dt>{if isset($type) && $type == "DS"}Digest Type{elseif isset($type) && $type == "TLSA"}Hash Type{else}port{/if}</dt>
                                                                <dd {if 'port'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="number" id="port" name="port" value="{if isset($port)}{$port}{else}0{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="number" id="port" name="port" value="{if isset($port)}{$port|escape}{else}0{/if}" maxlength="255" class="form-control medium">
                                                                        {if 'port'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>
                                                        <dl id="data">
                                                                <dt>{if isset($type) && $type == "DS"}Digest{elseif isset($type) && $type == "TLSA"}Hash{else}Data{/if}</dt>
                                                                <dd {if 'data'|in_array:$error}class="form-group has-error"{/if}>
-                                                                       <input type="text" id="data" name="data" value="{if isset($data)}{$data}{/if}" maxlength="255" class="form-control medium">
+                                                                       <input type="text" id="data" name="data" value="{if isset($data)}{$data|escape}{/if}" class="form-control medium">
                                                                        {if 'data'|in_array:$error}<span class="help-block">Please correct the error</span>{/if}
                                                                </dd>
                                                        </dl>