diff --git a/src/OlmServer/OlmApi.php b/src/OlmServer/OlmApi.php index 6346def..92a48ce 100644 --- a/src/OlmServer/OlmApi.php +++ b/src/OlmServer/OlmApi.php @@ -1349,11 +1349,11 @@ public function controllerUsersGetMulti(\Symfony\Component\HttpFoundation\Reques public function controllerUsersPost(\Symfony\Component\HttpFoundation\Request $request) { $data = json_decode($request->getContent(), true); - if ($data['password'] !== $data['check']) { + if ($data['password'] !== $data['repeat']) { $this->sendError(self::RESPONSE_PASSWORDS_DO_NOT_MATCH); } - unset($data['check']); + unset($data['repeat']); if (isset($data['password']) && !empty($data['password'])) { $password = $data['password']; @@ -1410,6 +1410,12 @@ public function controllerUsersPatch(\Symfony\Component\HttpFoundation\Request $ $user = $this->getCurrentUser(); + if ($data['password'] !== $data['repeat']) { + $this->sendError(self::RESPONSE_PASSWORDS_DO_NOT_MATCH); + } + + unset($data['repeat']); + if (!isset($data['check'])) { $this->sendError(self::RESPONSE_PASSWORD_MISSING); } diff --git a/src/config/cfg.php b/src/config/cfg.php index fbc9954..79e3ddb 100644 --- a/src/config/cfg.php +++ b/src/config/cfg.php @@ -1,7 +1,8 @@ 'utf8mb4', ), )); -$prefix = 'olm_'; +$prefix = $cfg['db_prefix']; // if the app recieves a JSON request decode the content $app->before(function (Request $request) {