Code Duplication    Length = 5-6 lines in 2 locations

lib/private/User/Session.php 2 locations

@@ 573-578 (lines=6) @@
570
			$this->emitFailedLogin($uid);
571
			return false;
572
		}
573
		if (!$user->isEnabled()) {
574
			// disabled users can not log in
575
			// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
576
			$message = \OC::$server->getL10N('lib')->t('User disabled');
577
			throw new LoginException($message);
578
		}
579
580
		//login
581
		$this->setUser($user);
@@ 913-917 (lines=5) @@
910
911
			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
912
913
			if (!$user->isEnabled()) {
914
				$message = \OC::$server->getL10N('lib')->t('User disabled');
915
				$this->emitFailedLogin($user->getUID());
916
				throw new LoginException($message);
917
			}
918
919
			$this->setUser($user);
920
			$this->setLoginName($user->getDisplayName());