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

SF.net SVN: ledger-smb:[6566] trunk/LedgerSMB/User.pm



Revision: 6566
          http://sourceforge.net/p/ledger-smb/code/6566
Author:   einhverfr
Date:     2014-01-21 04:58:13 +0000 (Tue, 21 Jan 2014)
Log Message:
-----------
fixing stylesheet/config issues when retrieving user's profile.

Modified Paths:
--------------
    trunk/LedgerSMB/User.pm

Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm	2014-01-21 04:51:53 UTC (rev 6565)
+++ trunk/LedgerSMB/User.pm	2014-01-21 04:58:13 UTC (rev 6566)
@@ -111,7 +111,10 @@
 
     my ( $self, $lsmb ) = @_;
 
-    my $login = $lsmb->{login};
+    my $login;
+    my $creds = LedgerSMB::Auth::get_credentials;
+    $login = $creds->{login};
+     
     my $dbh = $lsmb->{dbh};
 
     if ( !$login ) { # Assume this is for current connected user
@@ -124,19 +127,8 @@
 		SELECT * FROM user_preference 
 		 WHERE id = (SELECT id FROM users WHERE username = ?)|;
     my $sth = $dbh->prepare($query);
-    $sth->execute($lsmb->{login});
+    $sth->execute($login);
     $myconfig = $sth->fetchrow_hashref(NAME_lc);
-    my ($templates) = 'DB';
-    my %date_query = (
-        'mm/dd/yy' => 'set DateStyle to \'SQL, US\'',
-        'mm-dd-yy' => 'set DateStyle to \'POSTGRES, US\'',
-        'dd/mm/yy' => 'set DateStyle to \'SQL, EUROPEAN\'',
-        'dd-mm-yy' => 'set DateStyle to \'POSTGRES, EUROPEAN\'',
-        'dd.mm.yy' => 'set DateStyle to \'GERMAN\''
-    );
-    $dbh->do( $date_query{ $myconfig{dateformat} } );
-
-    my ($templates) = 'DB';
     $myconfig->{templates} = "DB";
     bless $myconfig, __PACKAGE__;
     return $myconfig;

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits