diff options
author | MichaIng <micha@dietpi.com> | 2021-10-11 15:38:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 15:38:52 +0300 |
commit | 6039a43d138b6505a2bde71d96a22bf542974c8b (patch) | |
tree | a7e4db9789116e607309adb1d7a4f96e1d1eb0b3 /lib/private | |
parent | da5063bf897d4795de83b28c03ece0f9d23aacbf (diff) | |
parent | e3f59fe2014df7c9027e6192b872dd8f498b4e02 (diff) |
Merge pull request #29164 from nextcloud/backport/29062/stable21
[stable21] Don't further setup disabled users when logging in with apache
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/legacy/OC_User.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index 3638a32589d..5d30bbc1209 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -36,6 +36,7 @@ * */ +use OC\User\LoginException; use OCP\EventDispatcher\IEventDispatcher; use OCP\ILogger; use OCP\IUserManager; @@ -171,6 +172,10 @@ class OC_User { if (self::getUser() !== $uid) { self::setUserId($uid); $userSession = \OC::$server->getUserSession(); + if ($userSession->getUser() && !$userSession->getUser()->isEnabled()) { + $message = \OC::$server->getL10N('lib')->t('User disabled'); + throw new LoginException($message); + } $userSession->setLoginName($uid); $request = OC::$server->getRequest(); $userSession->createSessionToken($request, $uid, $uid); |