Skip to content

Commit e3f59fe

Browse files
committed
Don't further setup disabled users when logging in with apache
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 6e7ec1d commit e3f59fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/private/legacy/OC_User.php

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
*
3737
*/
3838

39+
use OC\User\LoginException;
3940
use OCP\EventDispatcher\IEventDispatcher;
4041
use OCP\ILogger;
4142
use OCP\IUserManager;
@@ -171,6 +172,10 @@ public static function loginWithApache(\OCP\Authentication\IApacheBackend $backe
171172
if (self::getUser() !== $uid) {
172173
self::setUserId($uid);
173174
$userSession = \OC::$server->getUserSession();
175+
if ($userSession->getUser() && !$userSession->getUser()->isEnabled()) {
176+
$message = \OC::$server->getL10N('lib')->t('User disabled');
177+
throw new LoginException($message);
178+
}
174179
$userSession->setLoginName($uid);
175180
$request = OC::$server->getRequest();
176181
$userSession->createSessionToken($request, $uid, $uid);

0 commit comments

Comments
 (0)