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

how to mass delete users awaiting approval

Discussion in 'XenForo Questions and Support' started by pheyde, Aug 28, 2012.

  1. pheyde

    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
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:

    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.
     
    Digital Doctor, Sim, oman and 4 others like this.
  3. pheyde

    pheyde Member

    ok thanks and how can i get rid of all these spam users Dx
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. GabrielVH

    GabrielVH Member

    Would it be possible to modify this template edit to delete all banned users?
     
  6. Morgain

    Morgain Well-Known Member

    Best to add the CAPTCHA option with question and answer - under Options.
    Otherwise you get loads of spam signups waiting email confirmation.
     
  7. GabrielVH

    GabrielVH Member

    Yeah, but the problem is I just want to delete spam accounts that have already signed up. They aren't needed.
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. This page is for moderated users, not banned users. An addon is required. Nor can this be done with a simple query.
     
  9. Kim

    Kim Well-Known Member

    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
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes.

    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.
     
    Kim likes this.
  11. Kim

    Kim Well-Known Member

    Thanks Jake.

    :)
     
  12. Robert F Schmitz

    Robert F Schmitz Well-Known Member

    Jake, you come through once again. Thank you.
     
  13. glorify

    glorify Well-Known Member

    Is there such an addon?
     
  14. Core Freedom

    Core Freedom Well-Known Member

    Jake, I'm logged in as the admin but can't seem to get to the "development" area. Where do I find this? o_O
     
  15. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add this to your library/config.php file:

    Code:
    $config['debug'] = 1;
    
     
    Core Freedom likes this.
  16. Core Freedom

    Core Freedom Well-Known Member

    Yes, but I can't find the library/config.php file because I don't know how to get into the Development area.
     
  17. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The file is on the server. Use FTP.
     
  18. Luis

    Luis Well-Known Member

  19. Core Freedom

    Core Freedom Well-Known Member

    Jake, I was able to find the library/config.php file in FTP but I still can't find the Development area. :-( How do I get in there?
     
  20. Core Freedom

    Core Freedom Well-Known Member

    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?
     

Share This Page