diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-10-04 12:59:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 12:59:35 +0200 |
commit | 857c769d7557aa7d925147ffa69012aa5f72495c (patch) | |
tree | 49af8878fe6224a7f7935b8610793ff4de75ce71 /lib | |
parent | 9acef06b0f90fd1df3529f9f8e6d8b5b2125015a (diff) | |
parent | 57a816a1a6a895515b5d0a23db86861df3c2e333 (diff) | |
download | nextcloud-server-857c769d7557aa7d925147ffa69012aa5f72495c.tar.gz nextcloud-server-857c769d7557aa7d925147ffa69012aa5f72495c.zip |
Merge pull request #28939 from nextcloud/bugfix/noid/dont-setup-disabled-users
Don't further setup disabled users when logging in with apache
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/OC_User.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index f955c5c6938..848f460dac5 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -35,6 +35,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ + +use OC\User\LoginException; use OCP\EventDispatcher\IEventDispatcher; use OCP\ILogger; use OCP\IUserManager; @@ -170,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); |