summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB/User.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm
index a020affb..95f3fc4f 100755
--- a/LedgerSMB/User.pm
+++ b/LedgerSMB/User.pm
@@ -713,15 +713,14 @@ sub save_member {
my $userCheck = $dbh->prepare("SELECT id FROM users WHERE username = ?");
$userCheck->execute($self->{login});
my ($userID) = $userCheck->fetchrow_array;
+ my $userConfExists = 0;
if($userID){
#got an id, check to see if it's in the users_conf table
- my $userConfCheck = $dbh->prepare("SELECT id FROM users_conf WHERE id = ?");
+ my $userConfCheck = $dbh->prepare("SELECT count(*) FROM users_conf WHERE id = ?");
$userConfCheck->execute($userID);
- if($userConfCheck->rows){
- my $userConfExists = 1;
- }
+ ($userConfExists) = $userConfCheck->fetchrow_array;
}
else{
my $userConfAdd = $dbh->prepare("SELECT create_user(?);");