summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB/Form.pm9
-rwxr-xr-xLedgerSMB/User.pm4
-rwxr-xr-xbin/admin.pl5
3 files changed, 6 insertions, 12 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index e952d1c3..041be3ce 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -2714,12 +2714,15 @@ sub update_defaults {
my ($self, $myconfig, $fld) = @_;
- if (!$self->{dbh}){
+ if (!$self->{dbh} && $self){
$self->db_init($myconfig);
- }
-
+ }
+
my $dbh = $self->{dbh};
+ if (!$self){
+ $dbh = $_[3];
+ }
my $query = qq|SELECT $fld FROM defaults FOR UPDATE|;
($_) = $dbh->selectrow_array($query);
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index 2acad971..7f3549c0 100755
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -752,7 +752,6 @@ sub create_config {
sub save_member {
-
my ($self, $memberfile, $userspath) = @_;
# format dbconnect and dboptions string
@@ -797,7 +796,6 @@ sub save_member {
$self->{dbpasswd} = pack 'u', $self->{dbpasswd};
chop $self->{dbpasswd};
}
-
if ($self->{password} ne $self->{old_password}) {
$self->{password} = crypt $self->{password}, substr($self->{login}, 0, 2) if $self->{password};
}
@@ -818,7 +816,6 @@ sub save_member {
print CONF "\n";
close CONF;
unlink "${memberfile}.LCK";
-
# create conf file
if (! $self->{'root login'}) {
@@ -840,7 +837,6 @@ sub save_member {
my ($id) = $sth->fetchrow_array;
$sth->finish;
-
if ($id) {
$query = qq|UPDATE employee SET
diff --git a/bin/admin.pl b/bin/admin.pl
index cd68191c..359defa7 100755
--- a/bin/admin.pl
+++ b/bin/admin.pl
@@ -793,11 +793,9 @@ sub save {
$myconfig = new User "$memberfile", "$form->{login}";
- $form->db_init(%myconfig);
# redo acs variable and delete all the acs codes
@acs = split /;/, $form->{acs};
-
$form->{acs} = "";
foreach $item (@acs) {
@@ -818,7 +816,6 @@ sub save {
$form->{dbpasswd} = $form->{"$form->{dbdriver}_dbpasswd"};
$form->{dbuser} = $form->{"$form->{dbdriver}_dbuser"};
$form->{dbname} = $form->{"$form->{dbdriver}_dbname"};
-
$form->isblank("dbname", $locale->text('Dataset missing!'));
$form->isblank("dbuser", $locale->text('Database User missing!'));
@@ -839,7 +836,6 @@ sub save {
$myconfig->{packpw} = 1;
$myconfig->save_member($memberfile, $userspath);
-
# create user template directory and copy master files
if (! -d "$form->{templates}") {
@@ -875,7 +871,6 @@ sub save {
}
$form->redirect($locale->text('User saved!'));
-
}