Skip to content

Commit

Permalink
allow admin to change user accounts more easily
Browse files Browse the repository at this point in the history
  • Loading branch information
randomchars42 committed Jul 29, 2017
1 parent b6a044b commit b04dadc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/OlmServer/OlmApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1418,13 +1418,13 @@ public function controllerUsersPatch(\Symfony\Component\HttpFoundation\Request $

if (!isset($data['check'])) {
$this->sendError(self::RESPONSE_PASSWORD_MISSING);
} else {
if (!$user->isAdmin() && !$this->app['users']->isPasswordValid($data['check'], $user->getPassword())) {
$this->sendError(self::RESPONSE_WRONG_PASSWORD);
}
unset($data['check']);
}

if (!$this->app['users']->isPasswordValid($data['check'], $user->getPassword())) {
$this->sendError(self::RESPONSE_WRONG_PASSWORD);
}
unset($data['check']);

if (isset($data['password']) && !empty($data['password'])) {
$data['password'] = $this->app['users']->encodePassword($data['password'], empty($data['salt']) ? null : $data['salt']);
} else {
Expand Down

0 comments on commit b04dadc

Please sign in to comment.