From 8a8c9386cbd3383b0134aae8e32b5995f8886fb2 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 19 Aug 2001 15:53:36 +0000 Subject: added user interface for svc_forward and vpopmail support --- httemplate/misc/process/catchall.cgi | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 httemplate/misc/process/catchall.cgi (limited to 'httemplate/misc/process/catchall.cgi') 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"); +} + +%> -- cgit v1.2.1 From 3d671921441ba8422650b54435a1959ad1d4c71d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 02:31:57 +0000 Subject: remove $Log$ messages. whew. --- httemplate/misc/process/catchall.cgi | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'httemplate/misc/process/catchall.cgi') diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi index 0d84d7c4e..6b1147633 100755 --- a/httemplate/misc/process/catchall.cgi +++ b/httemplate/misc/process/catchall.cgi @@ -1,15 +1,5 @@ <% -# -# $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 ); -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/misc/process/catchall.cgi | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'httemplate/misc/process/catchall.cgi') diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi index 6b1147633..cf6f8d751 100755 --- a/httemplate/misc/process/catchall.cgi +++ b/httemplate/misc/process/catchall.cgi @@ -1,26 +1,14 @@ + <% -# - -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; +my $svcnum =$1; -$old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum; +my $old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum; -$new = new FS::svc_domain ( { +my $new = new FS::svc_domain ( { map { ($_, scalar($cgi->param($_))); } ( fields('svc_domain'), qw( pkgnum svcpart ) ) @@ -28,6 +16,7 @@ $new = new FS::svc_domain ( { $new->setfield('action' => 'M'); +my $error; if ( $svcnum ) { $error = $new->replace($old); } else { -- cgit v1.2.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/misc/process/catchall.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/misc/process/catchall.cgi') diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi index cf6f8d751..44a63f9f8 100755 --- a/httemplate/misc/process/catchall.cgi +++ b/httemplate/misc/process/catchall.cgi @@ -1,4 +1,3 @@ - <% $FS::svc_domain::whois_hack=1; -- cgit v1.2.1