Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 11-07-2019 20:24:18

CrownRoyal
Member
Registered: 01-10-2009
Posts: 716

how to deal with spam accounts?

I don't check the user accounts often. Today I looked in, and on the first 250 accounts that show up, 50 of them are spam accounts.

What actions can be tightened up to fix this issue?

Last edited by CrownRoyal (11-07-2019 20:24:32)

Offline

 

#2 11-07-2019 20:27:54

CrownRoyal
Member
Registered: 01-10-2009
Posts: 716

Re: how to deal with spam accounts?

And is there a way to clean them up rather than deleting one at a time. I did a search for the dollar sign in the username, which is a common occurance based on what I'm seeing, an there are 309. of those. A search of the word bitcoin produces 142.

Offline

 

#3 11-08-2019 09:06:41

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: how to deal with spam accounts?

You can use System / Database / Raw Database Admin to execute Raw SQL Statements against the database.  You can delete rows using searches.  For example, to remove all accounts with 'bitcoin' in the email address, execute:

DELETE FROM core_users WHERE id LIKE '%bitcoin%'

Or to delete all accounts with a '$' in the email address:

DELETE FROM core_users WHERE id LIKE '%$%'

Or either 'bitcoin' or '$' in the email address:

DELETE FROM core_users WHERE id LIKE '%bitcoin%' OR id LIKE '%$%'

This will help you with SQL wildcards and searches:

https://www.w3schools.com/sql/sql_wildcards.asp


Nick Hendler

Offline

 

#4 11-12-2019 09:42:00

CrownRoyal
Member
Registered: 01-10-2009
Posts: 716

Re: how to deal with spam accounts?

The query for bitcoin worked, but not the one for the dollar sign.

Offline

 

#5 11-12-2019 10:10:55

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: how to deal with spam accounts?

You may need to escape the dollar sign with:

DELETE FROM core_users WHERE id LIKE '%\$%'


Nick Hendler

Offline

 

#6 11-12-2019 10:54:51

CrownRoyal
Member
Registered: 01-10-2009
Posts: 716

Re: how to deal with spam accounts?

figured it out

Offline

 

#7 12-28-2019 13:15:11

CrownRoyal
Member
Registered: 01-10-2009
Posts: 716

Re: how to deal with spam accounts?

This is an ongoing issue with spam accounts. There must be some way to create something like a cron job to run daily or weekly?

Offline

 

#8 12-30-2019 09:36:46

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: how to deal with spam accounts?

Sure.  Create a file named 0999_customrmusers.php with the following content and save it to {private}/core/CORE/tasks_daily:

Code:

<?php 

// +------------------------------------------------------------------+
// | Class Definition                                                 |
// +------------------------------------------------------------------+

class CORE_cron_customrmusers extends CORE {

// +------------------------------------------------------------------+
// | Class Variables                                                  |
// +------------------------------------------------------------------+

var $class   = 'CORE_cron_customrmusers';
var $version = '9.0.0';

var $CORE_DB;

// +------------------------------------------------------------------+
// | Constructor Function                                             |
// +------------------------------------------------------------------+

function __construct () {

// +--
// | This is the constructor function.  This function starts up the
// | class.  Any pre-load variable assignments go here.
// +--

if ($this->debug) {$this->debugger("constructor: Accessed.");}

// +--
// | Quick object load: CORE_DB
// +--

$this->CORE_DB =& $this->quick_object('CORE_DB','core','CORE_DB_1');

if ($this->IsError($this->CORE_DB)) {$this->cerror = $this->CORE_DB; return;}

// +--
// | Return $this.
// +--

return;

} // End of function.

// +------------------------------------------------------------------+
// | Function: exec                                                   |
// +------------------------------------------------------------------+

function exec () {

// +--
// | This function removes malformed user accounts.
// +--

$sql  = "DELETE FROM core_users WHERE id LIKE '%\$%' OR id LIKE '%bitcoin%'";

$this->CORE_DB->sql_do(array('sql' => $sql, 'table' => 'core_users'));

if ($this->debug) {$this->debugger("exec: Deleted malformed user accounts from the database.");}

// +--
// | Return true.
// +--

return 1;

} // End of function.

// +------------------------------------------------------------------+
// | End of Class                                                     |
// +------------------------------------------------------------------+

} // End of class.

// +------------------------------------------------------------------+
// | End Of File                                                      |
// +------------------------------------------------------------------+

?>

Nick Hendler

Offline

 

Board footer