summaryrefslogtreecommitdiff
path: root/common.pl
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-12 08:39:17 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-12 08:39:17 +0000
commit349ac60f6e282919f88a507fbca3938e3f17c4da (patch)
tree2802d197ca398844ed7bb73b4191e16815a10c75 /common.pl
parentc569e60bf34de095fec410d9239260ed344e40d9 (diff)
Fixing redirect bug that causes form data to be lost
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@526 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'common.pl')
-rw-r--r--common.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/common.pl b/common.pl
index ac104f82..5f5c9f13 100644
--- a/common.pl
+++ b/common.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!c:\vanilla-perl\perl\bin\perl
#
######################################################################
# LedgerSMB Accounting and ERP
@@ -27,8 +27,8 @@ sub redirect {
use List::Util qw(first);
my ($script, $argv) = split(/\?/, $form->{callback});
- my @common_attrs =
- qw(dbh login favicon stylesheet titlebar password
+ my @common_attrs = qw(
+ dbh login favicon stylesheet titlebar password custom_db_fields
);
if (!$script){ # http redirect to login.pl if called w/no args
@@ -40,13 +40,20 @@ sub redirect {
$form->error($locale->text(__FILE__.':'.__LINE__.':'.$script.':'."Invalid Redirect"))
unless first {$_ eq $script} @{LedgerSMB::Sysconfig::scripts};
- $oldform = $form;
+ my %temphash;
+ for (@common_attrs){
+ $temphash{$_} = $form->{$_};
+ }
+
require "bin/$script";
+ undef $form;
$form = new Form($argv);
for (@common_attrs){
- $form->{$_} = $oldform->{$_};
+ $form->{$_} = $temphash{$_};
}
+
+ $form->debug;
if (!$myconfig){ # needed for login
%myconfig = %{LedgerSMB::User->fetch_config($form->{login})};
}