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

SF.net SVN: ledger-smb: [2195] trunk



Revision: 2195
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2195&view=rev
Author:   einhverfr
Date:     2008-07-07 15:49:08 -0700 (Mon, 07 Jul 2008)

Log Message:
-----------
Removing unnecessary debugging code from LedgerSMB.pm, adding option to force username case to make this case insensitive

Modified Paths:
--------------
    trunk/LedgerSMB/Auth/DB.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB/Auth/DB.pm
===================================================================
--- trunk/LedgerSMB/Auth/DB.pm	2008-07-07 18:19:50 UTC (rev 2194)
+++ trunk/LedgerSMB/Auth/DB.pm	2008-07-07 22:49:08 UTC (rev 2195)
@@ -29,6 +29,7 @@
 #====================================================================
 package LedgerSMB::Auth;
 use MIME::Base64;
+use LedgerSMB::Sysconfig;
 use strict;
 
 sub session_check {
@@ -232,6 +233,13 @@
     $auth = MIME::Base64::decode($auth);
     my $return_value = {};
     ($return_value->{login}, $return_value->{password}) = split(/:/, $auth);
+    if (defined $LedgerSMB::Sysconfig::force_username_case){
+        if (lc($LedgerSMB::Sysconfig::force_username_case) eq 'lower'){
+            $return_value->{login} = lc($return_value->{login});
+        } elsif (lc($LedgerSMB::Sysconfig::force_username_case) eq 'upper'){
+            $return_value->{login} = uc($return_value->{login});
+        }
+    }
 
     return $return_value;
     

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2008-07-07 18:19:50 UTC (rev 2194)
+++ trunk/LedgerSMB/Sysconfig.pm	2008-07-07 22:49:08 UTC (rev 2195)
@@ -17,6 +17,8 @@
 $auth = 'DB';
 $logging = 0;      # No logging on by default
 
+$force_username_case = undef; # don't force case
+
 @io_lineitem_columns = qw(unit onhand sellprice discount linetotal);
 
 # Whitelist for redirect destination
@@ -82,7 +84,7 @@
 # Root variables
 for $var (
     qw(pathsep logging check_max_invoices language auth latex
-    db_autoupdate)
+    db_autoupdate force_username_case)
   )
 {
     ${$var} = $config{''}{$var} if $config{''}{$var};

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2008-07-07 18:19:50 UTC (rev 2194)
+++ trunk/LedgerSMB.pm	2008-07-07 22:49:08 UTC (rev 2195)
@@ -375,7 +375,6 @@
     my $amount   = $args{amount};
     my $places   = $args{precision};
     my $dash     = $args{neg_format};
-    print STDERR "Formatting $amount in format $myconfig->{numberformat}\n";
 
     my $negative;
     if ($amount) {


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