diff options
author | jeff <jeff> | 2001-08-19 15:53:36 +0000 |
---|---|---|
committer | jeff <jeff> | 2001-08-19 15:53:36 +0000 |
commit | 8a8c9386cbd3383b0134aae8e32b5995f8886fb2 (patch) | |
tree | fb0dae094afa7bbf0a3fe0e8bd24091ae6b8e69d /httemplate/misc/process | |
parent | 8c7396531e6bf6f7c6cc4e5d19e2d381442223c5 (diff) |
added user interface for svc_forward and vpopmail support
Diffstat (limited to 'httemplate/misc/process')
-rwxr-xr-x | httemplate/misc/process/catchall.cgi | 55 |
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"); +} + +%> |