summaryrefslogtreecommitdiff
path: root/httemplate/misc/process
diff options
context:
space:
mode:
authorjeff <jeff>2001-08-19 15:53:36 +0000
committerjeff <jeff>2001-08-19 15:53:36 +0000
commit8a8c9386cbd3383b0134aae8e32b5995f8886fb2 (patch)
treefb0dae094afa7bbf0a3fe0e8bd24091ae6b8e69d /httemplate/misc/process
parent8c7396531e6bf6f7c6cc4e5d19e2d381442223c5 (diff)
added user interface for svc_forward and vpopmail support
Diffstat (limited to 'httemplate/misc/process')
-rwxr-xr-xhttemplate/misc/process/catchall.cgi55
1 files changed, 55 insertions, 0 deletions
diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi
new file mode 100755
index 000000000..0d84d7c4e
--- /dev/null
+++ b/httemplate/misc/process/catchall.cgi
@@ -0,0 +1,55 @@
+<%
+#
+# $Id: catchall.cgi,v 1.1 2001-08-19 15:53:35 jeff Exp $
+#
+# Usage: post form to:
+# http://server.name/path/catchall.cgi
+#
+# $Log: catchall.cgi,v $
+# Revision 1.1 2001-08-19 15:53:35 jeff
+# added user interface for svc_forward and vpopmail support
+#
+#
+
+use strict;
+use vars qw( $cgi $svcnum $old $new $error );
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use FS::UID qw(cgisuidsetup);
+use FS::Record qw(qsearchs fields);
+use FS::svc_domain;
+use FS::CGI qw(popurl);
+
+$FS::svc_domain::whois_hack=1;
+
+$cgi = new CGI;
+cgisuidsetup($cgi);
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+$svcnum =$1;
+
+$old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum;
+
+$new = new FS::svc_domain ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ } ( fields('svc_domain'), qw( pkgnum svcpart ) )
+} );
+
+$new->setfield('action' => 'M');
+
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->getfield('svcnum');
+}
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "catchall.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+}
+
+%>