how to mass delete users awaiting approval

pheyde

Member
my forum at coconutbeef.com has been getting a ton of spam so i turned on registration approval. but now i have 350 spam users awaiting approval so how can i just delete them all thanks
 
Admin CP -> Users -> Users Awaiting Approval

It gives you the option to delete each user.

Unfortunately there is no option to mass-select an option on that page. But if you enable debug mode then you can edit the associated template to change the defaults. Add this line to your library/config.php file:

Code:
$config['debug'] = 1;

Then edit this template:

Admin CP -> Development -> Admin Templates -> user_moderated

Replace the contents of that template with this:

Rich (BB code):
<xen:title>{xen:phrase users_awaiting_approval}</xen:title>

<xen:form action="{xen:adminlink 'users/moderated/update'}">
	<xen:foreach loop="$users" value="$user">
		<fieldset>
			<xen:controlunit label="{xen:phrase user}:"><a href="{xen:adminlink users/edit, $user}" target="_blank">{$user.username}</a> ({$user.email})</xen:controlunit>
			<xen:radiounit label="{xen:phrase action}:" name="users[{$user.user_id}][action]">
				<xen:option value="none">{xen:phrase do_nothing}</xen:option>
				<xen:option value="approve">{xen:phrase approve}</xen:option>
				<xen:option value="reject" selected="true">
					<xen:label>{xen:phrase reject_and_delete_with_rejection_reason}:</xen:label>
					<xen:textbox placeholder="{xen:phrase optional}" name="users[{$user.user_id}][reject_reason]" size="45" />
				</xen:option>
			</xen:radiounit>
			<xen:checkboxunit label="">
				<xen:option name="users[{$user.user_id}][notify]">{xen:phrase notify_user_if_action_was_taken}</xen:option>
			</xen:checkboxunit>
		</fieldset>
	</xen:foreach>
	
	<xen:submitunit save="{xen:phrase process_users}" />
</xen:form>

I just changed the default selections.
 
If say you were wanting to clean up 1500 or so users awaiting approval, would you use this technique?

And if so...

Would you then have to replace the code afterwards to revert to the original template once you had cleaned up?

Thanks :)

Kim
 
If say you were wanting to clean up 1500 or so users awaiting approval, would you use this technique?

Yes.

Would you then have to replace the code afterwards to revert to the original template once you had cleaned up?

Doesn't matter. The template edit just changes the default selection to "delete". You can change it back or manually click a different option when you load the list of users.
 
  • Like
Reactions: Kim
ah, I got it. Didn't realize that the library change was "opening" the development area. I was able to make the changes. Works great. Do I need to remove that library code again to hide the development area?
 
Back
Top Bottom