Code Duplication    Length = 4-6 lines in 2 locations

lib/private/User/Session.php 2 locations

@@ 768-771 (lines=4) @@
765
766
		$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
767
768
		if (!$user->isEnabled()) {
769
			$message = \OC::$server->getL10N('lib')->t('User disabled');
770
			throw new LoginException($message);
771
		}
772
773
		$this->setUser($user);
774
		$this->setLoginName($user->getDisplayName());
@@ 524-529 (lines=6) @@
521
			// user does not exist
522
			return false;
523
		}
524
		if (!$user->isEnabled()) {
525
			// disabled users can not log in
526
			// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
527
			$message = \OC::$server->getL10N('lib')->t('User disabled');
528
			throw new LoginException($message);
529
		}
530
531
		//login
532
		$this->setUser($user);