From 0dc37dc19e55aa4101017532ca02e0f43496d783 Mon Sep 17 00:00:00 2001 From: tetragon Date: Tue, 28 Nov 2006 21:22:47 +0000 Subject: Imposing restrictions on configurable attributes in save_preferences (1601425) git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@703 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/AM.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm index b3e94bbb..91df2123 100755 --- a/LedgerSMB/AM.pm +++ b/LedgerSMB/AM.pm @@ -1329,11 +1329,10 @@ sub save_preferences { # update name $query = qq| UPDATE employee - SET name = ?, - role = ? + SET name = ? WHERE login = ?|; - @queryargs = ($form->{name}, $form->{role}, $form->{login}); + @queryargs = ($form->{name}, $form->{login}); $dbh->prepare($query)->execute(@queryargs) || $form->dberror($query); # get default currency @@ -1351,9 +1350,10 @@ sub save_preferences { my $myconfig = LedgerSMB::User->new($form->{login}); - foreach my $item (keys %$form) { - $myconfig->{$item} = $form->{$item}; - } + map {$myconfig->{$_} = $form->{$_} if exists $form->{$_}} + qw(name email dateformat signature numberformat vclimit tel fax + company menuwidth countrycode address timeout stylesheet + printer password); $myconfig->{password} = $form->{new_password} if ($form->{old_password} ne $form->{new_password}); -- cgit v1.2.3