fefrei
(Felix Freiberger)
12. Dezember 2017 um 08:54
5
I’ve documented Rails code that (in addition to doing other things) logs out all users and sends them the usual notification that there were logged out here, in case this helps you:
Another year has passed, and we followed the same procedure. This time, we used actual Ruby scripts instead of my crazy API-based approach – maybe this is useful to someone else:
Log out and deactivate (almost) all users:
protected_users = ["system", "codinghorror"] # do not process these users
# get all users that should be logged out
affected_users = User.all.select { |u| !(protected_users.include? u.username) }
affected_users.each { |u|
u.admin = false
u.moderator = false
…
7 „Gefällt mir“