Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't further setup disabled users when logging in with apache
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Oct 4, 2021
commit 7eface3bfddd5b6765dcf0aa25b8339799002fcb
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