| @@ 467-477 (lines=11) @@ | ||
| 464 | ); |
|
| 465 | } |
|
| 466 | ||
| 467 | if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) { |
|
| 468 | return new DataResponse( |
|
| 469 | array( |
|
| 470 | 'status' => 'error', |
|
| 471 | 'data' => array( |
|
| 472 | 'message' => (string)$this->l10n->t('Authentication error') |
|
| 473 | ) |
|
| 474 | ), |
|
| 475 | Http::STATUS_FORBIDDEN |
|
| 476 | ); |
|
| 477 | } |
|
| 478 | ||
| 479 | if($user) { |
|
| 480 | if($user->delete()) { |
|
| @@ 743-755 (lines=13) @@ | ||
| 740 | */ |
|
| 741 | public function setEMailAddress($id, $mailAddress) { |
|
| 742 | $user = $this->userManager->get($id); |
|
| 743 | if (!$this->isAdmin |
|
| 744 | && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user) |
|
| 745 | ) { |
|
| 746 | return new DataResponse( |
|
| 747 | array( |
|
| 748 | 'status' => 'error', |
|
| 749 | 'data' => array( |
|
| 750 | 'message' => (string)$this->l10n->t('Forbidden') |
|
| 751 | ) |
|
| 752 | ), |
|
| 753 | Http::STATUS_FORBIDDEN |
|
| 754 | ); |
|
| 755 | } |
|
| 756 | ||
| 757 | if($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) { |
|
| 758 | return new DataResponse( |
|