summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorivan <ivan>2002-02-11 19:38:58 +0000
committerivan <ivan>2002-02-11 19:38:58 +0000
commitf255042296a645e7d90c19ee6740796250cfb9f3 (patch)
tree3864e6e2edb214bc389a70434a51345496225566 /httemplate/edit/process
parent505345d25040f78a9fdffa5666cd6b9f41a117a5 (diff)
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
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/svc_www.cgi36
1 files changed, 36 insertions, 0 deletions
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 );
+}
+
+%>