From 9e80fcdc9cba524a7407f01c92a0e6188247c7df Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sun, 25 Nov 2007 21:31:56 +0000 Subject: Handling missing login values git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1906 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/User.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'LedgerSMB/User.pm') diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm index 659ad7e1..0f2f0ec4 100644 --- a/LedgerSMB/User.pm +++ b/LedgerSMB/User.pm @@ -170,8 +170,10 @@ sub fetch_config { 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| -- cgit v1.2.3