v4 style
[freeside.git] / httemplate / elements / handle_uri_query
1 <%doc>
2
3 Usage (before accessing any $cgi parameters):
4
5 $m->comp('/elements/handle_uri_query');
6
7 </%doc>
8 <%init>
9
10 #my %opt = @_;
11
12 if ( $cgi->param('redirect') ) {
13   my $session = $cgi->param('redirect');
14   my $maxrecords = $cgi->param('maxrecords');
15
16   my $pref = $FS::CurrentUser::CurrentUser->option("redirect$session");
17   die "unknown redirect session $session\n" unless length($pref);
18   $cgi = new CGI($pref);
19
20   foreach my $param (grep /pay(info\d?|cvv)$/, $cgi->param) {
21     my $value = $cgi->param($param);
22     next unless length($value);
23     my $decrypted = FS::Record->decrypt( $value );
24     $cgi->param($param, $decrypted);
25   }
26
27   $cgi->param('maxrecords', $maxrecords) if $maxrecords =~ /^(\d+)$/;
28
29 }
30 </%init>