From f255042296a645e7d90c19ee6740796250cfb9f3 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 11 Feb 2002 19:38:58 +0000 Subject: svc_www is working! also auto-create and add A records if necessary using apacheip config file. and show all domain_records on view/svc_domain.cgi page --- httemplate/edit/process/svc_www.cgi | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 httemplate/edit/process/svc_www.cgi (limited to 'httemplate/edit/process/svc_www.cgi') diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi new file mode 100644 index 000000000..38d5e1c79 --- /dev/null +++ b/httemplate/edit/process/svc_www.cgi @@ -0,0 +1,36 @@ +<% + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +my $svcnum = $1; + +my $old; +if ( $svcnum ) { + $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) + or die "fatal: can't find account (svcnum $svcnum)!"; +} else { + $old = ''; +} + +my $new = new FS::svc_www ( { + map { + ($_, scalar($cgi->param($_))); + #} qw(svcnum pkgnum svcpart recnum usersvc) + } ( fields('svc_www'), qw( pkgnum svcpart ) ) +} ); + +my $error; +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum ); +} + +%> -- cgit v1.2.1 From 7283d56b43fad5d8c9d4b2f224f0e49201f9e901 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 23 Jun 2002 05:44:54 +0000 Subject: patch to get this working from Stephen Bechard --- httemplate/edit/process/svc_www.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/svc_www.cgi') diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi index 38d5e1c79..40913145a 100644 --- a/httemplate/edit/process/svc_www.cgi +++ b/httemplate/edit/process/svc_www.cgi @@ -5,8 +5,8 @@ my $svcnum = $1; my $old; if ( $svcnum ) { - $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) - or die "fatal: can't find account (svcnum $svcnum)!"; + $old = qsearchs('svc_www', { 'svcnum' => $svcnum } ) + or die "fatal: can't find website (svcnum $svcnum)!"; } else { $old = ''; } -- cgit v1.2.1