Config parameter to reserve domains for 'official' use

This commit is contained in:
Al Beano 2017-08-12 11:48:22 +01:00
parent 98c3c97e34
commit 2056412910
3 changed files with 16 additions and 0 deletions

View File

@ -18,6 +18,11 @@ plugins:
tld: 'cyb'
reserved_domains:
# use lowercase please
- "opennic"
- "dns"
zonewriter:
# Values used for SOA
ns: 'ns12.opennic.glue'

View File

@ -50,6 +50,14 @@ post '/domains/new' => sub {
}
}
if (scalar(keys(%errs)) == 0) {
foreach my $disallowed (@{ config->{"reserved_domains"} }) {
if ($name eq $disallowed) {
$errs{"e_reserved"} = 1;
}
}
}
if (scalar(keys(%errs)) != 0) {
return template 'domains/new' => {
%errs,

View File

@ -16,6 +16,9 @@
<% IF e_chars %>
The domain '<% params.name | html_entity %>.<% vars.config.tld %>' contains invalid characters.
<% END %>
<% IF e_reserved %>
The domain '<% params.name | html_entity %>.<% vars.config.tld %>' is reserved for use by the registry.
<% END %>
</div>
<br /><br />
</center>