diff options
author | ivan <ivan> | 1998-04-17 05:37:07 +0000 |
---|---|---|
committer | ivan <ivan> | 1998-04-17 05:37:07 +0000 |
commit | dd013679940cb0a4425eeff4df263e390d9c42e4 (patch) | |
tree | 41c8454948d5a9db8c6ce03f39c13a9694b81001 /htdocs/misc/unsusp_pkg.cgi | |
parent | 9307a5317a1dcf9fafd8b6bac8ffc70c505f9e2b (diff) |
Initial revision
Diffstat (limited to 'htdocs/misc/unsusp_pkg.cgi')
-rwxr-xr-x | htdocs/misc/unsusp_pkg.cgi | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/htdocs/misc/unsusp_pkg.cgi b/htdocs/misc/unsusp_pkg.cgi new file mode 100755 index 000000000..2f340c6fa --- /dev/null +++ b/htdocs/misc/unsusp_pkg.cgi @@ -0,0 +1,68 @@ +#!/usr/bin/perl -Tw +# +# susp_pkg.cgi: Unsuspend a package +# +# Usage: susp_pkg.cgi pkgnum +# http://server.name/path/susp_pkg.cgi pkgnum +# +# Note: Should be run setuid freeside as user nobody +# +# probably should generalize this to do cancels, suspensions, unsuspensions, etc. +# +# ivan@voicenet.com 97-feb-27 +# +# now redirects to enter comments +# ivan@voicenet.com 97-may-8 +# +# rewrote for new API +# ivan@voicenet.com 97-jul-21 +# +# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 + +use strict; +use CGI::Base qw(:DEFAULT :CGI); # CGI module +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs); +use FS::cust_pkg; + +my($cgi) = new CGI::Base; +$cgi->get; +&cgisuidsetup($cgi); + +#untaint pkgnum +$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; +my($pkgnum)=$1; + +my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); + +bless($cust_pkg,'FS::cust_pkg'); +my($error)=$cust_pkg->unsuspend; +&idiot($error) if $error; + +$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); + +sub idiot { + my($error)=@_; + SendHeaders(); + print <<END; +<HTML> + <HEAD> + <TITLE>Error unsuspending package</TITLE> + </HEAD> + <BODY> + <CENTER> + <H1>Error unsuspending package</H1> + </CENTER> + <HR> + There has been an error unsuspending this package: $error + </BODY> + </HEAD> +</HTML> +END + exit; +} + |