summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-30 21:14:50 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-30 21:14:50 +0000
commit29c86d0d226bf46c96ff9eedde0232d016e32722 (patch)
tree1227716b65b73eda57e9df2011da55f09a3d7bc4
parent15cdd7a96407c035138e18e84921cf6cf415e661 (diff)
Load the destination script after initiating a db connection. Stops redirects
to bin/ps.pl from blowing up. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1826 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--common.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/common.pl b/common.pl
index dc5684a5..2755dee7 100644
--- a/common.pl
+++ b/common.pl
@@ -48,20 +48,20 @@ sub redirect {
undef $form;
$form = new Form($argv);
- require "bin/$script";
for (@common_attrs) {
$form->{$_} = $temphash{$_};
}
$form->{script} = $script;
- if ( !$myconfig ) { # needed for login
+ if ( !%myconfig ) { # needed for login
%myconfig = %{ LedgerSMB::User->fetch_config( $form->{login} ) };
}
if ( !$form->{dbh} and ( $script ne 'admin.pl' ) ) {
$form->db_init( \%myconfig );
}
+ require "bin/$script";
&{ $form->{action} };
}