From 349ac60f6e282919f88a507fbca3938e3f17c4da Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sun, 12 Nov 2006 08:39:17 +0000 Subject: 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 --- common.pl | 17 ++++++++++++----- 1 file 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})}; } -- cgit v1.2.3