Code Duplication    Length = 4-6 lines in 2 locations

lib/private/User/Session.php 2 locations

@@ 743-746 (lines=4) @@
740
741
		$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
742
743
		if (!$user->isEnabled()) {
744
			$message = \OC::$server->getL10N('lib')->t('User disabled');
745
			throw new LoginException($message);
746
		}
747
748
		$this->setUser($user);
749
		$this->setLoginName($user->getDisplayName());
@@ 523-528 (lines=6) @@
520
			// user does not exist
521
			return false;
522
		}
523
		if (!$user->isEnabled()) {
524
			// disabled users can not log in
525
			// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
526
			$message = \OC::$server->getL10N('lib')->t('User disabled');
527
			throw new LoginException($message);
528
		}
529
530
		//login
531
		$this->setUser($user);