summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>1999-08-03 07:43:33 +0000
committerivan <ivan>1999-08-03 07:43:33 +0000
commit9f2781f5d45997c856e1930757daa2cb1d5cddcc (patch)
treeb44bc7922789e66aeba1545cd2126effbfc44587
parent53437ddeba0439876f496eae235700d46ea7645f (diff)
use Net::Whois;
-rw-r--r--TODO5
-rw-r--r--htdocs/docs/install.html1
-rw-r--r--site_perl/svc_domain.pm42
3 files changed, 30 insertions, 18 deletions
diff --git a/TODO b/TODO
index 670201602..12bacc8c5 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-$Id: TODO,v 1.36 1999-07-29 19:13:06 ivan Exp $
+$Id: TODO,v 1.37 1999-08-03 07:43:33 ivan Exp $
If you are interested in helping with any of these, please join the mailing
list (send a blank message to ivan-freeside-subscribe@sisd.com) to avoid
@@ -6,6 +6,9 @@ duplication of effort.
---
+take the GPL'ed whois proxy stuff at www.geektools.com and turn it into
+intelligence for Net::Whois.
+
A web version of the fs_passwd stuff would be nifty.
If you have Cistron authenticating directly from MySQL, you can replicate
diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html
index 5db8f2e4e..8c88a5acb 100644
--- a/htdocs/docs/install.html
+++ b/htdocs/docs/install.html
@@ -19,6 +19,7 @@ Before installing, you need:
<li><a href="http://www.perl.com/CPAN/modules/by-module/URI">URI</a>
<li><a href="http://www.perl.com/CPAN/modules/by-module/HTTP">HTML-Parser</a>
<li><a href="http://www.perl.com/CPAN/modules/by-module/Net">libnet</a>
+ <li><a href="http://www.perl.com/CPAN/modules/by-module/Net">Net::Whois</a> with this <a href="Net-Whois-0.23-ivan1.patch">patch</a> applied
<li><a href="http://www.perl.com/CPAN/modules/by-module/LWP/">libwww-perl</a>
<li><a href="http://www.perl.com/CPAN/modules/by-module/Business/">Business-CreditCard</a>
<li><a href="http://www.perl.com/CPAN/modules/by-module/Data/">Data-ShowTable</a>
diff --git a/site_perl/svc_domain.pm b/site_perl/svc_domain.pm
index 19aac3f88..17fdd19d5 100644
--- a/site_perl/svc_domain.pm
+++ b/site_perl/svc_domain.pm
@@ -8,6 +8,7 @@ use Carp;
use Mail::Internet;
use Mail::Header;
use Date::Format;
+use Net::Whois; #0.24;
use FS::Record qw(fields qsearch qsearchs);
use FS::Conf;
use FS::svc_Common;
@@ -132,11 +133,11 @@ sub insert {
return "Domain in use (here)"
if qsearchs( 'svc_domain', { 'domain' => $self->domain } );
- my $whois = ($self->_whois)[0];
+ my $whois = $self->whois;
return "Domain in use (see whois)"
- if ( $self->action eq "N" && $whois !~ /^No match for/ );
+ if ( $self->action eq "N" && $whois );
return "Domain not found (see whois)"
- if ( $self->action eq "M" && $whois =~ /^No match for/ );
+ if ( $self->action eq "M" && ! $whois );
$error = $self->SUPER::insert;
return $error if $error;
@@ -254,25 +255,27 @@ sub check {
}
-=item _whois
+=item whois
+
+Returns the Net::Whois object corresponding to this domain, or undef if
+the domain is not found in whois.
-Executes the command:
+(If $FS::svc_domain::whois_hack is true, returns that in all cases instead.)
+
+=cut
- whois do $domain
+sub whois {
+ $whois_hack or new Net::Whois::Domain $_[0]->domain;
+}
-and returns the output.
+=item _whois
-(Always returns I<No match for domian "$domain".> if
-$FS::svc_domain::whois_hack is set true.)
+Depriciated.
=cut
sub _whois {
- my $self = shift;
- my $domain = $self->domain;
- return ( "No match for domain \"$domain\"." ) if $whois_hack;
- open(WHOIS, "whois do $domain |");
- return <WHOIS>;
+ die "_whois depriciated";
}
=item submit_internic
@@ -390,7 +393,7 @@ sub submit_internic {
=head1 VERSION
-$Id: svc_domain.pm,v 1.7 1999-04-07 14:40:15 ivan Exp $
+$Id: svc_domain.pm,v 1.8 1999-08-03 07:43:33 ivan Exp $
=head1 BUGS
@@ -407,7 +410,9 @@ The $recref stuff in sub check should be cleaned up.
=head1 SEE ALSO
L<FS::svc_Common>, L<FS::Record>, L<FS::Conf>, L<FS::cust_svc>,
-L<FS::part_svc>, L<FS::cust_pkg>, L<FS::SSH>, L<ssh>, L<dot-qmail>, schema.html from the base documentation, config.html from the base documentation.
+L<FS::part_svc>, L<FS::cust_pkg>, L<FS::SSH>, L<Net::Whois>, L<ssh>,
+L<dot-qmail>, schema.html from the base documentation, config.html from the
+base documentation.
=head1 HISTORY
@@ -426,7 +431,10 @@ ivan@sisd.com 98-jul-17-19
pod, some FS::Conf (not complete) ivan@sisd.com 98-sep-23
$Log: svc_domain.pm,v $
-Revision 1.7 1999-04-07 14:40:15 ivan
+Revision 1.8 1999-08-03 07:43:33 ivan
+use Net::Whois;
+
+Revision 1.7 1999/04/07 14:40:15 ivan
use all stuff that's qsearch'ed to avoid warnings
Revision 1.6 1999/01/25 12:26:17 ivan