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

SF.net SVN: ledger-smb: [1826] branches/1.2/common.pl



Revision: 1826
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1826&view=rev
Author:   tetragon
Date:     2007-10-30 14:14:50 -0700 (Tue, 30 Oct 2007)

Log Message:
-----------
Load the destination script after initiating a db connection.  Stops redirects
to bin/ps.pl from blowing up.

Modified Paths:
--------------
    branches/1.2/common.pl

Modified: branches/1.2/common.pl
===================================================================
--- branches/1.2/common.pl	2007-10-30 02:29:04 UTC (rev 1825)
+++ branches/1.2/common.pl	2007-10-30 21:14:50 UTC (rev 1826)
@@ -48,20 +48,20 @@
 
     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} };
 }
 


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