• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Mass user state change

Blue

Well-known member
#1
I need to select a certain group via the batch update and change their state to "Awaiting email verification (from edit)" to force an email change

The closest thing I can find is to change them to Unregistered / Unconfirmed

What would be the best way to accomplish this?
 

Jake Bunce

XenForo moderator
Staff member
#2
Code:
UPDATE xf_user
SET user_state = 'email_confirm_edit'
WHERE user_state = 'valid'
AND (
	user_group_id = 2
	OR FIND_IN_SET(2, secondary_group_ids)
);
Invalid users are given the permissions of the Unregistered group despite not being an explicit member of that group.