From ab76730ec2f89dbc98714eb2b5d6fb26e38745a1 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 19 Oct 2006 04:24:58 +0000 Subject: Fixed user creation bug git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@232 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 9 ++++++--- LedgerSMB/User.pm | 4 ---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'LedgerSMB') 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 -- cgit v1.2.3