Is there a way to prevent someone from logging into the platform? We realize that you can set the
Active state for the
django.auth_user instance to disabled, however, when the user tries to login it notifies the user through email on how to activate their account. This is good for the learners who created an account and maybe forgot to continue use of the platform by clicking their activation email to verify that it’s their account.
How could we restrict login to the platform for anyone? I don’t want to have to get into unenrolling/re-enrolling them from the course but rather prevent them from logging in.
Thanks @e0d. Is there a way to reactivate their account later?
We’re not interested in deleting/retiring the user account but rather preventing them from logging in for a given duration. Pause their login attempts and then when the time is right we can re-enable them to re-login.
Support > Manage User does seem to do what we want. I ran the interface at https://edx-platform-lms/support/manage_user and clicked
Disable Account. Then it immediately logged out the user. To allow the user to re-login later I just set their password.
If you are willing to develop some code for this there is a specific filter from the hooks framework for this.
It is called
StudentLoginRequested and it is fired here.
You could create a plugin that implements the logic that you want and that raises
StudentLoginRequested.PreventLogin when the user matches your criteria for cooling down the login.