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 (
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 (
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');
<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>
<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>