RT# 73422 Fix report Customer Contacts
[freeside.git] / httemplate / misc / whois.cgi
1 <% include("/elements/header.html","Whois $domain", menubar(
2   ( $custnum
3     ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
4       )
5     : ()
6   ),
7   "View this domain (#$svcnum)" => "${p}view/svc_domain.cgi?$svcnum",
8 )) %>
9
10 <PRE><% $whois %></PRE>
11
12 <% include('/elements/footer.html') %>
13
14 <%init>
15
16 my $svcnum = $cgi->param('svcnum');
17 my $custnum = $cgi->param('custnum');
18 my $domain = $cgi->param('domain');
19
20 my $display_custnum;
21 if ( $custnum ) {
22   my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
23   $display_custnum = $cust_main->display_custnum;
24 }
25
26 my $whois = eval { whois($domain) };
27   if ( $@ ) {
28     ( $whois = $@ ) =~ s/ at \/.*Net\/Whois\/Raw\.pm line \d+.*$//s;
29   } else {
30     $whois =~ s/^\n+//;
31   }
32
33 </%init>