summaryrefslogtreecommitdiff
path: root/httemplate/misc/whois.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/whois.cgi')
-rw-r--r--httemplate/misc/whois.cgi33
1 files changed, 33 insertions, 0 deletions
diff --git a/httemplate/misc/whois.cgi b/httemplate/misc/whois.cgi
new file mode 100644
index 0000000..533b2d7
--- /dev/null
+++ b/httemplate/misc/whois.cgi
@@ -0,0 +1,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>