Skip to content

Commit

Permalink
Merge pull request #28939 from nextcloud/bugfix/noid/dont-setup-disab…
Browse files Browse the repository at this point in the history
…led-users

Don't further setup disabled users when logging in with apache
  • Loading branch information
LukasReschke authored Oct 4, 2021
2 parents 9acef06 + 57a816a commit 857c769
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/private/legacy/OC_User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -170,6 +172,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 857c769

Please sign in to comment.