summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/ftp_target.html12
-rw-r--r--httemplate/edit/process/upload_target.html25
2 files changed, 25 insertions, 12 deletions
diff --git a/httemplate/edit/process/ftp_target.html b/httemplate/edit/process/ftp_target.html
deleted file mode 100644
index 35f56c4..0000000
--- a/httemplate/edit/process/ftp_target.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<& elements/process.html,
- 'table' => 'ftp_target',
- 'viewall_dir' => 'browse',
- 'agent_null' => 1,
-&>
-<%init>
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->access_right('Configuration');
-
-</%init>
diff --git a/httemplate/edit/process/upload_target.html b/httemplate/edit/process/upload_target.html
new file mode 100644
index 0000000..8755bed
--- /dev/null
+++ b/httemplate/edit/process/upload_target.html
@@ -0,0 +1,25 @@
+<& 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($_));
+ }
+ }
+}
+
+</%init>