summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/upload_target.html
blob: f6cb9cd5b382bc9809719410b0a44dfcb0be5253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<& elements/process.html,
           'table'            => 'upload_target',
           'viewall_dir'      => 'browse',
           'agent_null'       => 1,
           'precheck_callback'=> \&precheck,
&>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;

die "access denied"
  unless $curuser->access_right('Configuration');

sub precheck {
  my $cgi = shift;
  my $protocol = $cgi->param('protocol');
  # promote whatever set of fields was selected to the "real" values
  my $params = $cgi->Vars;
  foreach ( keys %$params ) {
    if ( $_ =~ /^${protocol}_(\w+)/ ) {
      $cgi->param($1, $cgi->param($_));
    }
  }

  ''; #no error
}

</%init>