X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fsvc_domain.pm;h=17fdd19d56c4e73a90fe88967ae4e485ca902d2b;hb=1e3eae905b861761f93643aa5fce14a8be5d9ed2;hp=f86723f4a027ce0fdb00fa1e2d58c340c4de1b5c;hpb=4a5b07fb140e6abe0c29122cf349ff3f917e9610;p=freeside.git diff --git a/site_perl/svc_domain.pm b/site_perl/svc_domain.pm index f86723f4a..17fdd19d5 100644 --- a/site_perl/svc_domain.pm +++ b/site_perl/svc_domain.pm @@ -8,10 +8,14 @@ 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; use FS::cust_svc; -use FS::Conf; +use FS::svc_acct; +use FS::cust_pkg; +use FS::cust_main; @ISA = qw( FS::svc_Common ); @@ -121,6 +125,7 @@ sub insert { local $SIG{QUIT} = 'IGNORE'; local $SIG{TERM} = 'IGNORE'; local $SIG{TSTP} = 'IGNORE'; + local $SIG{PIPE} = 'IGNORE'; $error = $self->check; return $error if $error; @@ -128,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; @@ -250,25 +255,27 @@ sub check { } -=item _whois +=item whois -Executes the command: +Returns the Net::Whois object corresponding to this domain, or undef if +the domain is not found in whois. + +(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 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 ; + die "_whois depriciated"; } =item submit_internic @@ -386,7 +393,7 @@ sub submit_internic { =head1 VERSION -$Id: svc_domain.pm,v 1.5 1998-12-30 00:30:47 ivan Exp $ +$Id: svc_domain.pm,v 1.8 1999-08-03 07:43:33 ivan Exp $ =head1 BUGS @@ -403,7 +410,9 @@ The $recref stuff in sub check should be cleaned up. =head1 SEE ALSO L, L, L, L, -L, L, L, L, L, schema.html from the base documentation, config.html from the base documentation. +L, L, L, L, L, +L, schema.html from the base documentation, config.html from the +base documentation. =head1 HISTORY @@ -422,7 +431,16 @@ 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.5 1998-12-30 00:30:47 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 +yet more mod_perl stuff + +Revision 1.5 1998/12/30 00:30:47 ivan svc_ stuff is more properly OO - has a common superclass FS::svc_Common Revision 1.3 1998/11/13 09:56:57 ivan