Code Duplication    Length = 4-6 lines in 2 locations

lib/private/User/Session.php 2 locations

@@ 850-853 (lines=4) @@
847
848
			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
849
850
			if (!$user->isEnabled()) {
851
				$message = \OC::$server->getL10N('lib')->t('User disabled');
852
				throw new LoginException($message);
853
			}
854
855
			$this->setUser($user);
856
			$this->setLoginName($user->getDisplayName());
@@ 544-549 (lines=6) @@
541
			// user does not exist
542
			return false;
543
		}
544
		if (!$user->isEnabled()) {
545
			// disabled users can not log in
546
			// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
547
			$message = \OC::$server->getL10N('lib')->t('User disabled');
548
			throw new LoginException($message);
549
		}
550
551
		//login
552
		$this->setUser($user);