Fixed bug where renaming of user to current name failed

This commit is contained in:
Lukas Metzger 2018-04-11 08:44:44 +02:00
parent 08289e6745
commit d2e4082dbc

View file

@ -287,7 +287,8 @@ class Users
$query = $this->db->prepare('SELECT id FROM users WHERE name=:name AND backend=\'native\'');
$query->bindValue(':name', $name);
$query->execute();
if ($query->fetch() !== false) {
$record = $query->fetch();
if ($record !== false && intval($record['id']) !== $userId) {
throw new \Exceptions\AlreadyExistentException();
}
}