Code Duplication    Length = 5-6 lines in 2 locations

lib/private/User/Session.php 2 locations

@@ 584-589 (lines=6) @@
581
			$this->emitFailedLogin($uid);
582
			return false;
583
		}
584
		if (!$user->isEnabled()) {
585
			// disabled users can not log in
586
			// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
587
			$message = \OC::$server->getL10N('lib')->t('User disabled');
588
			throw new LoginException($message);
589
		}
590
591
		//login
592
		$this->setUser($user);
@@ 991-995 (lines=5) @@
988
989
			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
990
991
			if (!$user->isEnabled()) {
992
				$message = \OC::$server->getL10N('lib')->t('User disabled');
993
				$this->emitFailedLogin($user->getUID());
994
				throw new LoginException($message);
995
			}
996
997
			$this->setUser($user);
998
			$this->setLoginName($user->getDisplayName());