[freeside-devel] Possible Changes to svc_www.cgi and svc_www.pm

Stephen Bechard steve at destek.net
Sun Jun 23 05:08:58 PDT 2002


----- Original Message -----
From: "ivan" <ivan at 420.am>
To: <ivan-freeside-devel at sisd.com>
Sent: Sunday, June 23, 2002 2:23 AM
Subject: Re: [freeside-devel] Possible Changes to svc_www.cgi and svc_www.pm


> On Sun, Jun 23, 2002 at 12:45:16AM -0400, Stephen Bechard wrote:
> > > > If you mean editing the DNS/zone data, there's already
> > > > (import from/export to) BIND and a web editor for the zone files.
> > >
> > > I noticed in that view/svc_domain.cgi there was a (delete) option for
each
> > > of the DNS/zone data records, but not and edit. I also noticed that
there
> > is
> > > no error checking on the deletion of these zones compared to
configured
> > > svc_www records that might be attached to it. :(
> >
> > Here is a quick fix for the above issue in the delete-domain_record.cgi
> > Should probably really be handled in the domain_record.pm
>
> Yes, send a patch against domain_record.pm instead.

I have restored delete-domain_record.cgi back to original and
here is the domain_record.pm patch diff:

--- /tarballs/freeside-1.4.0pre14/FS/FS/domain_record.pm      Mon Jun 10
19:02:41 2002
+++ /usr/local/lib/perl5/site_perl/5.005/FS/domain_record.pm    Sun Jun 23
08:02:09 2002
@@ -5,6 +5,7 @@
 #use FS::Record qw( qsearch qsearchs );
 use FS::Record qw( qsearchs dbh );
 use FS::svc_domain;
+use FS::svc_www;

 @ISA = qw(FS::Record);

@@ -123,6 +124,9 @@

 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';

Enjoy,
Steve




More information about the freeside-devel mailing list