「すべての既存ユーザーを一括承認して、「ユーザー承認を必須にする」ことを容易にする

So far, I’ve been running our forum in invite-only mode – which is great. I’d now like to start opening it up a little bit more, such that I can send people to the address to sign up, but require approval of their accounts before they gain access. The “must approve users” setting’s warning is making me a little leery of enabling it, though.

In reading through recent posts here on meta, it looks like:

  • Invited users are not considered “approved” by default.
  • If I enable this flag, and use the UI to approve each user, they won’t receive “your account has been approved” emails.

What I’d really like to do is approve all the users currently in the system en-masse, and then flip the switch. (I would really, really prefer not to manually approve each user, as I have 140 at the moment.) A couple of questions related to this:

  • Can I simply do this by updating the database:
update users set
  approved = true, approved_by_id = 1, approved_at = current_timestamp
where not approved and active
「いいね!」 1

Does anyone have any insights on this? I’m loathe to just do something without a better understanding of how it all works… :confused: I’m happy to go spelunking through the Discourse code for approval if someone can point me in the right direction. :slight_smile:

That should, in theory do the trick, as always try on a backup first.

「いいね!」 4

Worked like a charm – thanks muchly @sam!

「いいね!」 2

This topic was automatically closed after 2768 days. New replies are no longer allowed.