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

SF.net SVN: ledger-smb:[5186] branches/1.3



Revision: 5186
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5186&view=rev
Author:   einhverfr
Date:     2012-11-13 10:06:14 +0000 (Tue, 13 Nov 2012)
Log Message:
-----------
FCGI-related fixes

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/Auth.pm
    branches/1.3/bin/aa.pl
    branches/1.3/old-handler.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-11-10 22:40:22 UTC (rev 5185)
+++ branches/1.3/Changelog	2012-11-13 10:06:14 UTC (rev 5186)
@@ -16,6 +16,7 @@
 * Changed upgrade screen to pull AR/AP numbers (Erik H)
 * Rebuild modules after upgrade, ensuring upgrade to latest version (Chris T)
 * Fixed credit limit usage calculations (Chris T, h/t Erik H)
+* Fixes to get LedgerSMB running clearly using FCGI (Chris T)
 
 Berend T is Berend Tober
 Chris T is Chris Travers

Modified: branches/1.3/LedgerSMB/Auth.pm
===================================================================
--- branches/1.3/LedgerSMB/Auth.pm	2012-11-10 22:40:22 UTC (rev 5185)
+++ branches/1.3/LedgerSMB/Auth.pm	2012-11-13 10:06:14 UTC (rev 5186)
@@ -74,6 +74,7 @@
 
 sub http_error {
     my ($errcode, $msg_plus) = @_;
+    $msg_plus = '' if not defined $msg_plus;
     my $cgi = CGI::Simple->new();
 
     my $err = {

Modified: branches/1.3/bin/aa.pl
===================================================================
--- branches/1.3/bin/aa.pl	2012-11-10 22:40:22 UTC (rev 5185)
+++ branches/1.3/bin/aa.pl	2012-11-13 10:06:14 UTC (rev 5186)
@@ -108,7 +108,6 @@
 }
 
 sub add {
-
     $form->{title} = "Add";
 	
     $form->{callback} =

Modified: branches/1.3/old-handler.pl
===================================================================
--- branches/1.3/old-handler.pl	2012-11-10 22:40:22 UTC (rev 5185)
+++ branches/1.3/old-handler.pl	2012-11-13 10:06:14 UTC (rev 5186)
@@ -48,7 +48,6 @@
 
 use LedgerSMB::Sysconfig;
 use Digest::MD5;
-use Error qw(:try);
 use LedgerSMB::App_State;
 
 $| = 1;
@@ -61,6 +60,7 @@
 use LedgerSMB::Auth;
 use LedgerSMB::CancelFurtherProcessing;
 use LedgerSMB::App_State;
+use Error qw(:try);
 use Data::Dumper;
 
 our $logger=Log::Log4perl->get_logger('old-handler-chain');#make logger available to other old programs
@@ -71,17 +71,25 @@
 eval { require "custom.pl"; };
 
 $form = new Form;
-
 # name of this script
-$0 =~ tr/\\/\//;
-$pos = rindex $0, '/';
-$script = substr( $0, $pos + 1 );
+my $script;
+if ($ENV{GATEWAY_INTERFACE} =~ /^CGI/){
+    $uri = $ENV{REQUEST_URI};
+    $uri =~ s/\?.*//;
+    $ENV{SCRIPT_NAME} = $uri;
+    $ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/;
+    $script = $1;
+} else {
+    $0 =~ tr/\\/\//;
+    $pos = rindex $0, '/';
+    $script = substr( $0, $pos + 1 );
+}
 
+
 $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} )
   or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" );
 
 
-
 # we use $script for the language module
 $form->{script} = $script;
 

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