summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-16 15:27:25 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-16 15:27:25 +0000
commit69ec77f6d98520ca738723c3bf1634291f32498b (patch)
tree1aef195dcacd84b213a216562e98245fb8d5e86e
parentc03b0c7d0ec23d0fa7690a8de6c9eebc650d0d71 (diff)
`cat svn-commit.2.tmp`
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@219 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm5
-rwxr-xr-xbin/admin.pl1
-rwxr-xr-xmenu.pl1
3 files changed, 6 insertions, 1 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 5f7adb01..4b6fbad2 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -2704,8 +2704,13 @@ sub update_defaults {
my ($self, $myconfig, $fld) = @_;
+ if (!$self->{dbh}){
+ $self->db_init($myconfig);
+ }
+
my $dbh = $self->{dbh};
+
my $query = qq|SELECT $fld FROM defaults FOR UPDATE|;
($_) = $dbh->selectrow_array($query);
diff --git a/bin/admin.pl b/bin/admin.pl
index 9a90830a..88ecc367 100755
--- a/bin/admin.pl
+++ b/bin/admin.pl
@@ -754,6 +754,7 @@ sub form_header {
sub save {
+ $form->db_init;
# no driver checked
$form->error($locale->text('Database Driver not checked!')) unless $form->{dbdriver};
diff --git a/menu.pl b/menu.pl
index 6482a66d..03d22670 100755
--- a/menu.pl
+++ b/menu.pl
@@ -106,7 +106,6 @@ $SIG{__DIE__} = sub { $form->error($_[0]) };
$myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
map { $form->{$_} = $myconfig{$_} } qw(stylesheet timeout) unless ($form->{type} eq 'preferences');
-
$form->db_init(\%myconfig);
if ($form->{path} ne 'bin/lynx'){ $form->{path} = 'bin/mozilla';}