1 <% include("/elements/header.html",'Domain View', menubar(
2 ( ( $pkgnum || $custnum )
3 ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
5 : ( "Delete this (unaudited) domain" =>
6 "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" )
10 <% include('/elements/error.html') %>
12 Service #<% $svcnum %>
13 <BR>Service: <B><% $part_svc->svc %></B>
14 <BR>Domain name: <B><% $domain %></B>
16 <BR>Status: <B><% $status %></B>
17 % if ( $FS::CurrentUser::CurrentUser->access_right('Manage domain registration') ) {
18 % if ( defined($ops{'register'}) ) {
19 <A HREF="<% ${p} %>edit/process/domreg.cgi?op=register&svcnum=<% $svcnum %>">Register at <% $registrar->{'name'} %></A>
21 % if ( defined($ops{'transfer'}) ) {
22 <A HREF="<% ${p} %>edit/process/domreg.cgi?op=transfer&svcnum=<% $svcnum %>">Transfer to <% $registrar->{'name'} %></A>
24 % if ( defined($ops{'renew'}) ) {
25 <A HREF="<% ${p} %>edit/process/domreg.cgi?op=renew&svcnum=<% $svcnum %>&period=1">Renew at <% $registrar->{'name'} %></A>
27 % if ( defined($ops{'revoke'}) ) {
28 <A HREF="<% ${p} %>edit/process/domreg.cgi?op=revoke&svcnum=<% $svcnum %>">Revoke</A>
33 % if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall') ) {
34 <BR>Catch all email <A HREF="<% ${p} %>misc/catchall.cgi?<% $svcnum %>">(change)</A>:
39 <% $email ? "<B>$email</B>" : "<I>(none)<I>" %>
40 <BR><BR><A HREF="<% ${p} %>misc/whois.cgi?custnum=<%$custnum%>;svcnum=<%$svcnum%>;domain=<%$domain%>">View whois information.</A>
43 function areyousure(href, message) {
44 if ( confirm(message) == true )
45 window.location.href = href;
47 function slave_areyousure() {
48 return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?");
52 % my @records; if ( @records = $svc_domain->domain_record ) {
54 <% include('/elements/table-grid.html') %>
56 % my $bgcolor1 = '#eeeeee';
57 % my $bgcolor2 = '#ffffff';
58 % my $bgcolor = $bgcolor2;
61 <th CLASS="grid" BGCOLOR="#cccccc">Zone</th>
62 <th CLASS="grid" BGCOLOR="#cccccc">Type</th>
63 <th CLASS="grid" BGCOLOR="#cccccc">Data</th>
66 % foreach my $domain_record ( @records ) {
67 % my $type = $domain_record->rectype eq '_mstr'
69 % : $domain_record->recaf. ' '. $domain_record->rectype;
73 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->reczone %></td>
74 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $type %></td>
75 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->recdata %>
77 % unless ( $domain_record->rectype eq 'SOA'
78 % || ! $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice')
80 % ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g;
81 (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>)
87 % if ( $bgcolor eq $bgcolor1 ) {
88 % $bgcolor = $bgcolor2;
90 % $bgcolor = $bgcolor1;
98 % if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') ) {
100 <FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
101 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
102 <INPUT TYPE="text" NAME="reczone">
103 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN
104 <SELECT NAME="rectype">
105 % foreach (qw( A NS CNAME MX PTR TXT) ) {
106 <OPTION VALUE="<%$_%>"><%$_%></OPTION>
109 <INPUT TYPE="text" NAME="recdata">
110 <INPUT TYPE="submit" VALUE="Add record">
117 <FORM NAME="SlaveForm" METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
118 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
120 Delete all records and
122 Slave from nameserver IP
123 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
124 <INPUT TYPE="hidden" NAME="reczone" VALUE="@">
125 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN">
126 <INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr">
127 <INPUT TYPE="text" NAME="recdata">
128 <INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()">
135 <% joblisting({'svcnum'=>$svcnum}, 1) %>
137 <% include('/elements/footer.html') %>
141 unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
143 my($query) = $cgi->keywords;
146 my $svc_domain = qsearchs({
147 'select' => 'svc_domain.*',
148 'table' => 'svc_domain',
149 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
150 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
151 ' LEFT JOIN cust_main USING ( custnum ) ',
152 'hashref' => {'svcnum'=>$svcnum},
153 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
154 'null_right' => 'View/link unlinked services'
157 die "Unknown svcnum" unless $svc_domain;
159 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
160 my $pkgnum = $cust_svc->getfield('pkgnum');
161 my($cust_pkg, $custnum, $display_custnum);
163 $cust_pkg = qsearchs('cust_pkg', {'pkgnum'=>$pkgnum} );
164 $custnum = $cust_pkg->custnum;
165 $display_custnum = $cust_pkg->cust_main->display_custnum;
171 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
172 die "Unknown svcpart" unless $part_svc;
175 if ($svc_domain->catchall) {
176 my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } );
177 die "Unknown svcpart" unless $svc_acct;
178 $email = $svc_acct->email;
181 my $domain = $svc_domain->domain;
183 my $status = 'Unknown';
186 my @exports = $part_svc->part_export();
191 # Find the first export that does domain registration
193 $export = $_ if $_->can('registrar');
195 # If we have a domain registration export, get the registrar object
197 $registrar = $export->registrar;
198 my $domstat = $export->get_status( $svc_domain );
199 if (defined($domstat->{'message'})) {
200 $status = $domstat->{'message'};
201 } elsif (defined($domstat->{'unregistered'})) {
202 $status = 'Not registered';
203 $ops{'register'} = "Register";
204 } elsif (defined($domstat->{'status'})) {
205 $status = $domstat->{'status'} . ' ' . $domstat->{'contact_email'} . ' ' . $domstat->{'last_update_time'};
206 } elsif (defined($domstat->{'expdate'})) {
207 $status = "Expires " . $domstat->{'expdate'};
208 $ops{'renew'} = "Renew";
209 $ops{'revoke'} = "Revoke";
211 $status = $domstat->{'reason'};
212 $ops{'transfer'} = "Transfer";