diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-07-14 16:48:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 16:48:24 +0300 |
commit | a32f165f201c666490bd3c40a8b12539b262f7f7 (patch) | |
tree | 8516547fb3c7350a468505cd637faa91be505ccd /lib/Controller | |
parent | a59a5fbdbb82eb6403c6d3e1694b90695d8c1638 (diff) | |
parent | 8fb14b5ffa3450b2c2201ff9bb42c589e4a4afb7 (diff) |
Merge pull request #5198 from nextcloud/enh/5173/ldap-aliases-provisioning
LDAP alias provisioning
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/AliasesController.php | 9 | ||||
-rw-r--r-- | lib/Controller/SettingsController.php | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/Controller/AliasesController.php b/lib/Controller/AliasesController.php index 8c1b49ddc..add3efb5f 100644 --- a/lib/Controller/AliasesController.php +++ b/lib/Controller/AliasesController.php @@ -72,8 +72,8 @@ class AliasesController extends Controller { * @NoAdminRequired * @TrapError */ - public function update() { - throw new NotImplemented(); + public function update(int $id, string $alias, string $aliasName): JSONResponse { + return new JSONResponse($this->aliasService->update($this->currentUserId, $id, $alias, $aliasName)); } /** @@ -84,7 +84,7 @@ class AliasesController extends Controller { * @return JSONResponse */ public function destroy(int $id): JSONResponse { - return new JSONResponse($this->aliasService->delete($id, $this->currentUserId)); + return new JSONResponse($this->aliasService->delete($this->currentUserId, $id)); } /** @@ -116,7 +116,6 @@ class AliasesController extends Controller { * @throws DoesNotExistException */ public function updateSignature(int $id, string $signature = null): JSONResponse { - $this->aliasService->updateSignature($this->currentUserId, $id, $signature); - return new JSONResponse(); + return new JSONResponse($this->aliasService->updateSignature($this->currentUserId, $id, $signature)); } } diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 2081ea5bb..dd1a19dc4 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -60,6 +60,8 @@ class SettingsController extends Controller { $this->provisioningManager->newProvisioning($data); } catch (ValidationException $e) { return HttpJsonResponse::fail([$e->getFields()]); + } catch (\Exception $e) { + return HttpJsonResponse::fail([$e->getMessage()]); } return new JSONResponse([]); @@ -67,12 +69,11 @@ class SettingsController extends Controller { public function updateProvisioning(int $id, array $data): JSONResponse { try { - $this->provisioningManager->updateProvisioning(array_merge( - $data, - ['id' => $id] - )); + $this->provisioningManager->updateProvisioning(array_merge($data, ['id' => $id])); } catch (ValidationException $e) { return HttpJsonResponse::fail([$e->getFields()]); + } catch (\Exception $e) { + return HttpJsonResponse::fail([$e->getMessage()]); } return new JSONResponse([]); |