Fix login when using a PostgreSQL database as authentication backend

fixes #8524
This commit is contained in:
Johannes Meyer 2015-03-06 11:03:45 +01:00
parent ff6658324a
commit f3fa743022
1 changed files with 6 additions and 1 deletions

View File

@ -96,10 +96,15 @@ class DbUserBackend extends UserBackend
'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;
}
/**