summaryrefslogtreecommitdiff
path: root/httemplate/misc/whois.cgi
blob: 533b2d7a8df3090559d8317439f50872b9015e29 (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
<% include("/elements/header.html","Whois $domain", menubar(
  ( $custnum
    ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
      )
    : ()
  ),
  "View this domain (#$svcnum)" => "${p}view/svc_domain.cgi?$svcnum",
)) %>

<PRE><% $whois %></PRE>

<% include('/elements/footer.html') %>

<%init>

my $svcnum = $cgi->param('svcnum');
my $custnum = $cgi->param('custnum');
my $domain = $cgi->param('domain');

my $display_custnum;
if ( $custnum ) {
  my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
  $display_custnum = $cust_main->display_custnum;
}

my $whois = eval { whois($domain) };
  if ( $@ ) {
    ( $whois = $@ ) =~ s/ at \/.*Net\/Whois\/Raw\.pm line \d+.*$//s;
  } else {
    $whois =~ s/^\n+//;
  }

</%init>