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

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



Revision: 1906
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1906&view=rev
Author:   einhverfr
Date:     2007-11-25 13:31:56 -0800 (Sun, 25 Nov 2007)

Log Message:
-----------
Handling missing login values

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

Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm	2007-11-25 21:07:55 UTC (rev 1905)
+++ trunk/LedgerSMB/User.pm	2007-11-25 21:31:56 UTC (rev 1906)
@@ -170,8 +170,10 @@
     my $login = $lsmb->{login};
     my $dbh = $lsmb->{dbh};
 
-    if ( !$login ) {
-        &error( $self, "Access Denied" );
+    if ( !$login ) { # Assume this is for current connected user
+        my $sth = $dbh->prepare('SELECT SESSION_USER');
+        $sth->execute();
+        ($login) = $sth->fetchrow_array();
     }
 
     $query = qq|


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