Limit user to one login

Permalink
I have a client wanting to use a one-time pin for students to login and take a survey. I know that you can't use a pin or just a password for this, but I think that limiting a user to one login and then disabling their account will work.

Is there a way to limit a user to just one login?

FatTony1952
 
PatrickCassidy replied on at Permalink Reply
PatrickCassidy
Yes mate. You can create a group, then if you go in to the settings of the group you can choose 'Group Expiration Options'. This will affect an entire group though, not the specific user account.

That's the only one I've had to use myself, there may be a way to set it differently, I just haven't looked in to it.
FatTony1952 replied on at Permalink Reply
FatTony1952
Yeah, I know about that option. You can expire accounts after a certain period of time, but it doesn't base it on logins.

Thanks, though.
mnakalay replied on at Permalink Reply
mnakalay
Hello,
One way you could do it is by using a mix of events and attributes.

you could use the user event on_user_login to set a checkbox user attribute to true (say you call it has_logged_in)

Then if the same student comes in later and wants to log in you check the attribute through the same event and if it's true you deactivate the account.

Of course this requires that loging in is not persistent else next time the student comes he will still be logged in and the system won't work.

ANother way is to have the survey submit action to deactivate the account.