summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-09 22:08:18 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-09 22:08:18 +0000
commit03eaef085d960aca5f6b8c97dc89c02fe215d06c (patch)
tree3f507fc26119a36cd68b42969d4987617470a310 /LedgerSMB
parent259a5bc1a9bb9f42f6816f913c170bb3b814eab6 (diff)
User::fetch_config now works, and there are some other auth fixes here too
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1730 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/User.pm26
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;
}