Skip to content

Commit

Permalink
Fix login when using a PostgreSQL database as authentication backend
Browse files Browse the repository at this point in the history
fixes #8524
  • Loading branch information
Johannes Meyer committed Mar 6, 2015
1 parent ff66583 commit f3fa743
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Icinga/Authentication/Backend/DbUserBackend.php
Expand Up @@ -96,10 +96,15 @@ protected function getPasswordHash($username)
'SELECT password_hash FROM icingaweb_user WHERE name = :name AND active = 1'
);
}

$stmt->execute(array(':name' => $username));
$stmt->bindColumn(1, $lob, PDO::PARAM_LOB);
$stmt->fetch(PDO::FETCH_BOUND);
return is_resource($lob) ? stream_get_contents($lob) : $lob;
if (is_resource($lob)) {
$lob = stream_get_contents($lob);
}

return $this->conn->getDbType() === 'pgsql' ? pg_unescape_bytea($lob) : $lob;
}

/**
Expand Down

0 comments on commit f3fa743

Please sign in to comment.