Skip to content

Commit

Permalink
Don't further setup disabled users when logging in with apache
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 11, 2021
1 parent 6bd8561 commit a1c4c7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/private/legacy/OC_User.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
*
*/

use OC\User\LoginException;
use OCP\ILogger;

/**
Expand Down Expand Up @@ -168,6 +169,10 @@ public static function loginWithApache(\OCP\Authentication\IApacheBackend $backe
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);
Expand Down

0 comments on commit a1c4c7f

Please sign in to comment.