forked from .cyb/cyberman
Config parameter to reserve domains for 'official' use
This commit is contained in:
parent
98c3c97e34
commit
2056412910
|
@ -18,6 +18,11 @@ plugins:
|
|||
|
||||
tld: 'cyb'
|
||||
|
||||
reserved_domains:
|
||||
# use lowercase please
|
||||
- "opennic"
|
||||
- "dns"
|
||||
|
||||
zonewriter:
|
||||
# Values used for SOA
|
||||
ns: 'ns12.opennic.glue'
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue