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

SF.net SVN: ledger-smb: [703] branches/1.2/LedgerSMB/AM.pm



Revision: 703
          http://svn.sourceforge.net/ledger-smb/?rev=703&view=rev
Author:   tetragon
Date:     2006-11-28 13:22:47 -0800 (Tue, 28 Nov 2006)

Log Message:
-----------
Imposing restrictions on configurable attributes in save_preferences (1601425)

Modified Paths:
--------------
    branches/1.2/LedgerSMB/AM.pm

Modified: branches/1.2/LedgerSMB/AM.pm
===================================================================
--- branches/1.2/LedgerSMB/AM.pm	2006-11-28 21:22:37 UTC (rev 702)
+++ branches/1.2/LedgerSMB/AM.pm	2006-11-28 21:22:47 UTC (rev 703)
@@ -1329,11 +1329,10 @@
 	# 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 @@
 
 	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});
 


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