blob: f6f8c71c71f61c405d393cdb37c0d2de127c6472 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
<SCRIPT>
function areyousure(href, message) {
if ( confirm(message) == true )
window.location.href = href;
}
function slave_areyousure() {
return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?");
}
</SCRIPT>
DNS records
% my @records; if ( @records = $svc_domain->domain_record ) {
<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = $bgcolor2;
<tr>
<th CLASS="grid" BGCOLOR="#cccccc">Zone</th>
<th CLASS="grid" BGCOLOR="#cccccc">Type</th>
<th CLASS="grid" BGCOLOR="#cccccc">Data</th>
</tr>
% foreach my $domain_record ( @records ) {
% my $type = $domain_record->rectype eq '_mstr'
% ? "(slave)"
% : $domain_record->recaf. ' '. $domain_record->rectype;
<tr>
<td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->reczone %></td>
<td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $type %></td>
<td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->recdata %>
% unless ( $domain_record->rectype eq 'SOA'
% || ! $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice')
% ) {
% ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g;
(<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>)
% }
</td>
</tr>
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
% } else {
% $bgcolor = $bgcolor1;
% }
% }
</table>
% }
% if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') ) {
<FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
<INPUT TYPE="text" NAME="reczone">
<INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN
<SELECT NAME="rectype">
% foreach (qw( A NS CNAME MX PTR TXT) ) {
<OPTION VALUE="<%$_%>"><%$_%></OPTION>
% }
</SELECT>
<INPUT TYPE="text" NAME="recdata">
<INPUT TYPE="submit" VALUE="Add record">
</FORM>
<FORM NAME="SlaveForm" METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
% if ( @records ) {
Delete all records and
% }
Or slave from nameserver IP
<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
<INPUT TYPE="hidden" NAME="reczone" VALUE="@">
<INPUT TYPE="hidden" NAME="recaf" VALUE="IN">
<INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr">
<INPUT TYPE="text" NAME="recdata">
<INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()">
</FORM>
% }
<%init>
my($svc_domain, %opt) = @_;
my $svcnum = $svc_domain->svcnum;
</%init>
|