diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/User.pm | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm index 0b295455..b5c5c757 100644 --- a/LedgerSMB/User.pm +++ b/LedgerSMB/User.pm @@ -174,24 +174,14 @@ sub fetch_config { &error( $self, "Access Denied" ); } - - # for now, this is querying the table directly... ugly -# my $fetchUserPrefs = $dbh->prepare( -# "SELECT acs, address, businessnumber, -# company, countrycode, currency, -# dateformat, dbdriver, dbhost, dbname, -# dboptions, dbpasswd, dbport, dbuser, -# email, fax, menuwidth, name, numberformat, -# password, print, printer, role, sid, -# signature, stylesheet, tel, templates, -# timeout, vclimit, u.username -# FROM users_conf as uc, users as u -# WHERE u.username = ? -# AND u.id = uc.id;" -# ); - - - return \%myconfig; + $query = qq| + SELECT * FROM user_preference + WHERE id = (SELECT id FROM users WHERE username = ?)|; + my $sth = $dbh->prepare($query); + $sth->execute($lsmb->{login}); + $myconfig = $sth->fetchrow_hashref(NAME_lc); + + return $myconfig; } |