| @@ 501-511 (lines=11) @@ | ||
| 498 | ); |
|
| 499 | } |
|
| 500 | ||
| 501 | if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
| 502 | return new DataResponse( |
|
| 503 | [ |
|
| 504 | 'status' => 'error', |
|
| 505 | 'data' => [ |
|
| 506 | 'message' => (string)$this->l10n->t('Authentication error') |
|
| 507 | ] |
|
| 508 | ], |
|
| 509 | Http::STATUS_FORBIDDEN |
|
| 510 | ); |
|
| 511 | } |
|
| 512 | ||
| 513 | if ($user) { |
|
| 514 | if ($user->delete()) { |
|
| @@ 568-580 (lines=13) @@ | ||
| 565 | } |
|
| 566 | ||
| 567 | if ($user) { |
|
| 568 | if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
| 569 | return new DataResponse( |
|
| 570 | [ |
|
| 571 | 'status' => 'error', |
|
| 572 | 'data' => [ |
|
| 573 | 'message' => (string)$this->l10n->t('Authentication error') |
|
| 574 | ] |
|
| 575 | ], |
|
| 576 | Http::STATUS_FORBIDDEN |
|
| 577 | ); |
|
| 578 | } |
|
| 579 | ||
| 580 | $user->setEnabled($enabled); |
|
| 581 | return new DataResponse( |
|
| 582 | [ |
|
| 583 | 'status' => 'success', |
|