Merge pull request #4030 from Icinga/fix/username-with-extraneous-spaces-are-not-invalid

Username with extraneous spaces are not invalid
This commit is contained in:
Johannes Meyer 2019-12-11 10:24:19 +01:00 committed by GitHub
commit 0bbc4c7c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -186,8 +186,9 @@ class DbUserBackend extends DbRepository implements UserBackendInterface, Inspec
$query = $this->ds->select()
->from($this->prependTablePrefix('user'), $columns)
->where('name', $username)
->where(($this->ds->getDbType() === 'mysql' ? 'BINARY ' : '') . 'name', $username)
->where('active', true);
$statement = $this->ds->getDbAdapter()->prepare($query->getSelectQuery());
$statement->execute();
$statement->bindColumn(1, $lob, PDO::PARAM_LOB);