@@ 526-536 (lines=11) @@ | ||
523 | ); |
|
524 | } |
|
525 | ||
526 | if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
527 | return new DataResponse( |
|
528 | [ |
|
529 | 'status' => 'error', |
|
530 | 'data' => [ |
|
531 | 'message' => (string)$this->l10n->t('Authentication error') |
|
532 | ] |
|
533 | ], |
|
534 | Http::STATUS_FORBIDDEN |
|
535 | ); |
|
536 | } |
|
537 | ||
538 | if ($user) { |
|
539 | if ($user->delete()) { |
|
@@ 593-605 (lines=13) @@ | ||
590 | } |
|
591 | ||
592 | if ($user) { |
|
593 | if (!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
594 | return new DataResponse( |
|
595 | [ |
|
596 | 'status' => 'error', |
|
597 | 'data' => [ |
|
598 | 'message' => (string)$this->l10n->t('Authentication error') |
|
599 | ] |
|
600 | ], |
|
601 | Http::STATUS_FORBIDDEN |
|
602 | ); |
|
603 | } |
|
604 | ||
605 | $user->setEnabled($enabled); |
|
606 | return new DataResponse( |
|
607 | [ |
|
608 | 'status' => 'success', |