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

Stephen Bechard steve at destek.net
Sat Jun 22 19:37:08 PDT 2002


> Thanks for the patches; applied.

As I was working on the edit svc_www.cgi I found that you had already
solved the . issue in the website name in the view/svc_www.cgi,
so to keep things consistent you might want the change my earlier fix
for svc_www.pm of $zone = "$zone.". $svc_domain->domain;
to $zone .= '.'. $svc_domain->domain;
Which should be the same ending result.

> On Sat, Jun 22, 2002 at 09:20:59PM -0400, Stephen Bechard wrote:
> > I am now going to work some scripts that will allow the options of
> > editing/modifing the reczone with the posibility to delete it as well.
> > Unless you know of someone else that is doing this...
>
> 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. :(

> svc_www is intended for website hosting with Apache or whatnot.  I could
> totally see some amount of automatic zone provisioning for websites,
> though.

I was referring to changing which recnum and usersvc that was attached to
the svc_www record.
For example changing recnum of the www to ww2, or changing the usersvc to a
different svc_acct.
I found that there was indeed a edit/svc_www.cgi which did just what I
wanted as long as the
other Records are present, there just wasn't a link from the view to the
edit.
The only thing I had to tweak was that the process/svc_www.cgi had to be
changed as it
seemed to be checking the wrong table. Is this Correct? Here is the diff:

*** /tarballs/freeside-1.4.0pre14/httemplate/edit/process/svc_www.cgi
Mon Feb 11 14:38:58 2002
--- ../edit/process/svc_www.cgi Sat Jun 22 21:55:47 2002
***************
*** 5,12 ****

  my $old;
  if ( $svcnum ) {
!   $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } )
!     or die "fatal: can't find account (svcnum $svcnum)!";
  } else {
    $old = '';
  }
--- 5,12 ----

  my $old;
  if ( $svcnum ) {
!   $old = qsearchs('svc_www', { 'svcnum' => $svcnum } )
!     or die "fatal: can't find website (svcnum $svcnum)!";
  } else {
    $old = '';
  }

I have added the above diff and the link to the edit/svc_www.cgi and life is
good.
Here is the link diff:

*** /tarballs/freeside-1.4.0pre14/httemplate/view/svc_www.cgi       Tue Feb
19 20:03:10 2002
--- svc_www.cgi Sat Jun 22 22:24:37 2002
***************
*** 41,46 ****
--- 41,50 ----
  )).
        "Service #$svcnum".
        qq!<BR>Website name: <B><A HREF="http://$www">$www</A></B>!.
+       '&nbsp;(&nbsp;<A HREF="'. popurl(2). 'edit/svc_www.cgi?'. $svcnum.
+           '">Edit</A>&nbsp;)'.
        '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
        '</BODY></HTML>'
  ;

However, this updates the recnum and usersvc in the svc_www table, but
doesn't
put anything back in the queue to make the necessary changes on the Remote
Server.
Is this not implemented yet?

The other part of this was to have the ability to delete the svc_www record
without
having to cancel all of the services in a Larger Package. I would rather
have an
unprovisioned service, than have to rebuild all of the other services, by
cancelling
one Package and Adding another.

> On Sat, Jun 22, 2002 at 09:20:59PM -0400, Stephen Bechard wrote:
> > I have been trying to get the svc_www.cgi working for quite some time
> > and I finally realized that it was only missing a closing %>
> >
> > *** /tarballs/freeside-1.4.0pre14/httemplate/edit/svc_www.cgi Mon Feb 18
> > 05:14:00 2002
> > --- /home/freeside/website/aspdocs/edit/svc_www.cgi     Sat Jun 22
21:12:21
> > 2002
> > ***************
> > *** 175,179 ****
> >     </BODY>
> >   </HTML>
> >   END
> > !
> > !
> > --- 175,178 ----
> >     </BODY>
> >   </HTML>
> >   END
> > ! %>
> >
> > Now that I have the svc_www.cgi working I was playing with
> > provisioning websites based on the A records that I had
> > entered into my domain. I noticed that if I created a site
> > it created all of the directories and symbolic links without
> > the period in-between the reczone and domain (reczonedomain.com)
> > If you are interested here is my fix and diff to correct this so
> > the outcome is reczone.domain.com
> >
> > *** /tarballs/freeside-1.4.0pre14/FS/FS/svc_www.pm    Mon Feb 11
14:38:58
> > 2002
> > --- /usr/local/lib/perl5/site_perl/5.005/FS/svc_www.pm  Sat Jun 22
20:54:32
> > 2002
> > ***************
> > *** 154,160 ****
> >       my $svc_domain = qsearchs('svc_domain', { 'svcnum' =>
$dom_svcnum } );
> >         # or die ?
> > !     $zone .= $svc_domain->domain;
> >     }
> >
> > --- 154,160 ----
> >       my $svc_domain = qsearchs('svc_domain', { 'svcnum' =>
$dom_svcnum } );
> >         # or die ?
> > !     $zone = "$zone.". $svc_domain->domain;
> >     }
> >
> > I am now going to work some scripts that will allow the options of
> > editing/modifing the reczone with the posibility to delete it as well.
> > Unless you know of someone else that is doing this...
> >
> > Enjoy,
> > Steve
> >
> >
>
> --
> _ivan
>




More information about the freeside-devel mailing list