Code Duplication    Length = 11-13 lines in 2 locations

settings/Controller/UsersController.php 2 locations

@@ 454-464 (lines=11) @@
451
			);
452
		}
453
454
		if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
455
			return new DataResponse(
456
				array(
457
					'status' => 'error',
458
					'data' => array(
459
						'message' => (string)$this->l10n->t('Authentication error')
460
					)
461
				),
462
				Http::STATUS_FORBIDDEN
463
			);
464
		}
465
466
		if($user) {
467
			if($user->delete()) {
@@ 730-742 (lines=13) @@
727
	 */
728
	public function setEMailAddress($id, $mailAddress) {
729
		$user = $this->userManager->get($id);
730
		if (!$this->isAdmin
731
			&& !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)
732
		) {
733
			return new DataResponse(
734
				array(
735
					'status' => 'error',
736
					'data' => array(
737
						'message' => (string)$this->l10n->t('Forbidden')
738
					)
739
				),
740
				Http::STATUS_FORBIDDEN
741
			);
742
		}
743
744
		if($mailAddress !== '' && !$this->mailer->validateMailAddress($mailAddress)) {
745
			return new DataResponse(