From: ivan Date: Sun, 23 Jun 2002 19:16:45 +0000 (+0000) Subject: domain_record records attached to svc_www records are no longer delete-able, X-Git-Tag: freeside_1_4_0_beta1~64 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=b32a862877102bd755bec2c83713b6f3ffb35dfa domain_record records attached to svc_www records are no longer delete-able, patch from "Stephen Bechard" , thanks! closes: Bug#434 --- diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm index 03f9e10bb..37cc6c9e8 100644 --- a/FS/FS/domain_record.pm +++ b/FS/FS/domain_record.pm @@ -5,6 +5,7 @@ use vars qw( @ISA $noserial_hack ); #use FS::Record qw( qsearch qsearchs ); use FS::Record qw( qsearchs dbh ); use FS::svc_domain; +use FS::svc_www; @ISA = qw(FS::Record); @@ -124,6 +125,9 @@ Delete this record from the database. sub delete { my $self = shift; + return "Can't delete a domain record which has a website!" + if qsearchs( 'svc_www', { 'recnum' => $self->recnum } ); + local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE'; @@ -309,7 +313,7 @@ sub svc_domain { =head1 VERSION -$Id: domain_record.pm,v 1.10 2002-06-10 23:02:41 ivan Exp $ +$Id: domain_record.pm,v 1.11 2002-06-23 19:16:45 ivan Exp $ =head1 BUGS