Code Duplication    Length = 11-13 lines in 2 locations

settings/Controller/UsersController.php 2 locations

@@ 478-488 (lines=11) @@
475
			);
476
		}
477
478
		if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
479
			return new DataResponse(
480
				array(
481
					'status' => 'error',
482
					'data' => array(
483
						'message' => (string)$this->l10n->t('Authentication error')
484
					)
485
				),
486
				Http::STATUS_FORBIDDEN
487
			);
488
		}
489
490
		if($user) {
491
			if($user->delete()) {
@@ 842-854 (lines=13) @@
839
	 */
840
	public function setEMailAddress($id, $mailAddress) {
841
		$user = $this->userManager->get($id);
842
		if (!$this->isAdmin
843
			&& !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)
844
		) {
845
			return new DataResponse(
846
				array(
847
					'status' => 'error',
848
					'data' => array(
849
						'message' => (string)$this->l10n->t('Forbidden')
850
					)
851
				),
852
				Http::STATUS_FORBIDDEN
853
			);
854
		}
855
856
		if($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
857
			return new DataResponse(