Will things ever be the same again?
[freeside.git] / httemplate / misc / process / expire_pkg.cgi
1 %
2 %
3 %#untaint date & pkgnum
4 %
5 %my $date;
6 %if ( $cgi->param('date') ) {
7 %  str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
8 %  $date=$1;
9 %} else {
10 %  $date='';
11 %}
12 %
13 %$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
14 %my $pkgnum = $1;
15 %
16 %my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
17 %my %hash = $cust_pkg->hash;
18 %$hash{expire}=$date;
19 %my $new = new FS::cust_pkg ( \%hash );
20 %my $error = $new->replace($cust_pkg);
21 %&eidiot($error) if $error;
22 %
23 %print $cgi->redirect(popurl(3). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
24 %
25 %
26