[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [526] trunk/common.pl



Revision: 526
          http://svn.sourceforge.net/ledger-smb/?rev=526&view=rev
Author:   einhverfr
Date:     2006-11-12 00:39:17 -0800 (Sun, 12 Nov 2006)

Log Message:
-----------
Fixing redirect bug that causes form data to be lost

Modified Paths:
--------------
    trunk/common.pl

Modified: trunk/common.pl
===================================================================
--- trunk/common.pl	2006-11-12 07:11:59 UTC (rev 525)
+++ trunk/common.pl	2006-11-12 08:39:17 UTC (rev 526)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!c:\vanilla-perl\perl\bin\perl
 #
 ######################################################################
 # LedgerSMB Accounting and ERP
@@ -27,8 +27,8 @@
 	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 @@
 	$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})};
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.