3 # $Id: cust_pkg.cgi,v 1.2 1998-12-17 08:40:23 ivan Exp $
5 # this is for changing packages around, not for editing things within the
9 # http://server.name/path/cust_pkg.cgi
11 # Note: Should be run setuid root as user nobody.
13 # ivan@voicenet.com 97-mar-21 - 97-mar-24
16 # ivan@voicenet.com 97-jul-7 - 15
18 # &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7
20 # Changes to allow page to work at a relative position in server
21 # bmccane@maxbaud.net 98-apr-3
23 # $Log: cust_pkg.cgi,v $
24 # Revision 1.2 1998-12-17 08:40:23 ivan
25 # s/CGI::Request/CGI.pm/; etc
30 use CGI::Carp qw(fatalsToBrowser);
31 use FS::UID qw(cgisuidsetup);
32 use FS::CGI qw(idiot popurl);
35 my($cgi)=new CGI; # create form object
40 $cgi->param('new_custnum') =~ /^(\d+)$/;
43 my(@remove_pkgnums) = map {
44 /^(\d+)$/ or die "Illegal remove_pkg value!";
46 } $cgi->param('remove_pkg');
50 foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) {
51 my($num_pkgs)=$cgi->param("pkg$pkgpart");
52 while ( $num_pkgs-- ) {
53 push @pkgparts,$pkgpart;
57 my($error) = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);
62 print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum#cust_pkg");