| @@ 484-494 (lines=11) @@ | ||
| 481 | ); |
|
| 482 | } |
|
| 483 | ||
| 484 | if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
| 485 | return new DataResponse( |
|
| 486 | [ |
|
| 487 | 'status' => 'error', |
|
| 488 | 'data' => [ |
|
| 489 | 'message' => (string)$this->l10n->t('Authentication error') |
|
| 490 | ] |
|
| 491 | ], |
|
| 492 | Http::STATUS_FORBIDDEN |
|
| 493 | ); |
|
| 494 | } |
|
| 495 | ||
| 496 | if($user) { |
|
| 497 | if($user->delete()) { |
|
| @@ 551-563 (lines=13) @@ | ||
| 548 | } |
|
| 549 | ||
| 550 | if($user) { |
|
| 551 | if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
| 552 | return new DataResponse( |
|
| 553 | [ |
|
| 554 | 'status' => 'error', |
|
| 555 | 'data' => [ |
|
| 556 | 'message' => (string) $this->l10n->t('Authentication error') |
|
| 557 | ] |
|
| 558 | ], |
|
| 559 | Http::STATUS_FORBIDDEN |
|
| 560 | ); |
|
| 561 | } |
|
| 562 | ||
| 563 | $user->setEnabled($enabled); |
|
| 564 | return new DataResponse( |
|
| 565 | [ |
|
| 566 | 'status' => 'success', |
|