Jump to content
Subwayhost

Mass Delete Spam Clients not working

Recommended Posts

Sorry for being noise here

 

I uploaded it to the hooks folder inside the whmcs 6.5.2 and it doesn't deleted anything also a white page for this issue!

Share this post


Link to post
Share on other sites

Hi @Subwayhost the hook was written for active LTS Versions, we didn't release a version 6.5.2 could you clarify what release you are using please

Share this post


Link to post
Share on other sites
57 minutes ago, WHMCS ChrisD said:

Hi @Subwayhost the hook was written for active LTS Versions, we didn't release a version 6.5.2 could you clarify what release you are using please

I'm using 6.5.2 version of WHMCS

Share this post


Link to post
Share on other sites
8 minutes ago, Subwayhost said:

I'm using 6.5.2 version of WHMCS

Our last release of the V6 branch was V6.3.1 on  13th April 2016 followed by v6.3.2 on 29th December 2016 we don't have a 6.5.2 release this hook was only tested on those releases in LTS Status that is Version 7.2 and above, so this hook may not work with earlier versions

Share this post


Link to post
Share on other sites
8 hours ago, WHMCS ChrisD said:

Our last release of the V6 branch was V6.3.1 on  13th April 2016 followed by v6.3.2 on 29th December 2016 we don't have a 6.5.2 release this hook was only tested on those releases in LTS Status that is Version 7.2 and above, so this hook may not work with earlier versions

I apologize it's v6.3.2

Share this post


Link to post
Share on other sites
1 hour ago, Subwayhost said:

I apologize it's v6.3.2

looking at the code, my guess is that v6 might not like the PHP array abbreviation [] in the $results line... changing it to array('clientid' => $client->id) might make it work in v6.

Share this post


Link to post
Share on other sites

Thanks everyone for the feedback!

To clarify, this file is not meant to run with the WHMCS hooks system as there is no add_hook() function call being made, so placing it in the /includes/hooks directory may not work. 

This file was meant to be a one-off solution to be used for removing the mass spam clients that were being created. In order to use it properly, you would simply place the file in your WHMCS root directory and then access the file from your browser to run it.

It should provide you with the output of what clients were able to be deleted or which clients were not (if any). You can run the script as many times as needed until all of the spam clients have been removed.

When you are done using the script, it should be removed from the server as it does contain code that destroys data (deletes clients). It shouldn't ever be an issue, but to be safe it is good practice to remove utility scripts when they aren't needed anymore.

As always, please remember to take a database backup before using this tool.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By HarryAdney
      I see this in Setup > Addon Modules. I use MailChimp; is it safe to delete the legacy module and am I correct in thinking it's the one shown in module/addons/admin?
       
      Cheers
    • By bluesteam
      Hi,
      So I have just signed up with crisp.  My business email address is info@bluesteam.net.  Crisp asks for an email address when signing up and sends you the chat transcripts after the conversation is complete.
      The problem is that Crisp sends these transcripts from some-random-sequence@bluesteam.on.crisp.email
      Now I have piping enabled for info@bluesteam.net for my General Queries Department so I keep getting the transcript opening tickets on the support system.
      NOW I have to go and delete every support ticket that gets opened because blacklisting each email address is pointless because the sequence will always change and never be the same so its useles to blacklist it.
      I want to add a wildcard in the Spam Control System *@bluesteam.on.crisp.email so that NO transcripts can open a ticket but lo and behold, there is no such thing as a wildcard on the Spam Control.
      How can this be?  It's such a simple feature that should be enabled with every spam control system.
      Has anyone got a solution to this?
      Thanks
      Brett
    • By postcd
      Hello, in WHMCS 6.3 in last days i started receiving significantly higher amount of SPAM support tickets than before. (bot spam not real people)
      So i tried to switch "Captcha Type" from "Default (5 Character Verification Code)" to "reCAPTCHA (Google's reCAPTCHA system)"
      I seen i already had prefilled public and private key there and i verified it is correct/same with keys in my google account where i added my site already.
      But when i open contact form as a non logged in user in Firefox and Tor browser, it does not show up the recaptcha, it shows only:
      When submitting, it says "The characters you entered didn't match the image shown. Please try again."
      Is there any work around/hack (by editting some files) so i can prevent support ticket SPAM?
      The default WHMCS 5 chars. captcha show up, but SPAM bots started going over it.
      In recaptcha account, server side integration URL is: https://www.google.com/recaptcha/api/siteverify
      <script src='https://www.google.com/recaptcha/api.js'></script>
      <div class="g-recaptcha" data-sitekey="PubKeyHere"></div>
      I see my recaptcha is "v2" type\
      Update: The cause of this issue was Content-Security-Policy in .htaccess file that denied google domain.
       
    • By WHMCS Josh
      An unfortunate trait of the internet is spam and automated bots disseminating that spam. As a business operator on the internet, you may also receive orders submitted in bulk by automated bots. There can be situations where you need to delete lots of clients with the same first name.
      This small script leverages the local API to cleanly delete all clients who match the specified term.
       
       
      This script is provided as-is, without warranty, and in the understanding for the potential to permanently and irreversibly delete data. Before running this script, please make a database backup:
      <?php /** * Delete spam clients where the firstname contains 5666Q.COM * using advanced database interaction and the DeleteClient API * * @link https://developers.whmcs.com/advanced/db-interaction/ * @link https://developers.whmcs.com/api-reference/deleteclient/ * * @author WHMCS Limited <development@whmcs.com> * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/eula/ WHMCS Eula */ require 'init.php'; use WHMCS\Database\Capsule; // Replace ADMIN_USERNAME with your admin username $adminUsername = 'ADMIN_USERNAME'; echo '<pre>'; // Loop through all clients where firstname contains 5666Q.COM foreach (Capsule::table('tblclients')->where('firstname', 'like', '%5666Q.COM%')->get() as $client) { // Delete the client with DeleteClient API $results = localAPI('DeleteClient', ['clientid' => $client->id], $adminUsername); // Check for errors if ($results['result'] == 'success') { echo "Deleted Client ID: " . $client->id; } else { echo "Error deleting Client ID: " . $client->id; } } echo '</pre>';  
      Begin by entering your adminstrator's username on line 19:
      $adminUsername = 'ADMIN_USERNAME'; Upload the script to your WHMCS directory, and visit in your browser.
      The script will search through all the clients matching the criteria specified in this line:
      'firstname', 'like', '%5666Q.COM%' It will then properly and permanently delete matching clients and associated records.
      The last step is to show which clients are deleted, and if a problem was occurred.
       
      The file should then be deleted from your server.
       
      At the time of writing this post, this script was tested on the latest stable release of WHMCS 7.5.1 and should work with any that fall under Active Support as per the LTS schedule here: https://docs.whmcs.com/Long_Term_Support#WHMCS_Version_.26_LTS_Schedule
      If you have any feedback, questions, or concerns that I did not cover in this post, please feel free to reach out!
      delete_spam_clients.php
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines