photo

Joe S.

shared this question
3 years ago

Employees Involved

photo

PIV Support

Admin

Statistics

9
Comments
464
Views

Share

Tags

1
votes

Is there a way to mass delete inactive agents and or members?

I have several thousand people signed up as agents but are inactive. Is there a way to do a batch delete either through OR or phpMyAdmin? I am using OR v3.0.12 free version.

Add Comment

Comments (9)

photo
1

O-R don't have this feature by default.

The right way to do that is with an add-on - be careful, there are several database tables to query (userdb, userdbelements, listingsdb, listingsdbelements, userfavoritelistings, usersavedsearches, listingsimages, userimages, vtourimages and usersfiles - maybe I forgot some) and delete data and also image files and files to drop. This is a tricky add-on to code!

[]s

photo Employee
1

OP needs to update their OR software. You are missing some very important security fixes that were released in 2011, not to mention all the bug fixes since 2010.

If your host's services become compromised, or your account is used to relay SPAM as a result of your running software with known vunerabilities, they will likely terminate your account. If for no other reason, you have that as motivation to upgrade unless losing your website and email is no big deal.

photo
1

Eduardo Marques wrote:

O-R don't have this feature by default.

The right way to do that is with an add-on - be careful, there are several database tables to query (userdb, userdbelements, listingsdb, listingsdbelements, userfavoritelistings, usersavedsearches, listingsimages, userimages, vtourimages and usersfiles - maybe I forgot some) and delete data and also image files and files to drop. This is a tricky add-on to code!

[]s

Thank you for your response Eduardo. These "agent" signups are all spammers and since the signup process requires an email link activation these accounts were never active so I don't think any database entries were created other than the in the userdb. None the less I'll check the other tables you mentioned to see if there were any entries made associated with these inactive signups.

photo
1

PIV Support wrote:

OP needs to update their OR software. You are missing some very important security fixes that were released in 2011, not to mention all the bug fixes since 2010.

If your host's services become compromised, or your account is used to relay SPAM as a result of your running software with known vunerabilities, they will likely terminate your account. If for no other reason, you have that as motivation to upgrade unless losing your website and email is no big deal.

My site has not been compromised and there are no security issues (all that said I will update OR to the latest version but I don't know how that would help in this situation). These "agents" are not active so they are not posting spam or anything else. The site is set where agents and members are

able to sign up and are inactive by default until they follow the email

link sent by the site to their email account and activate by following

that link back. Since spammers usually give fictitious email or they

can't be bothered to go to the trouble of account activation, it would

be nice to be able to mass delete these signups.

photo Employee
1

The suggestion that you upgrade your old software was not intended to solve your present problem or imply your site is currently compromised. It was offered to help you prevent future problems, as you are running a known vulnerable version of OR that if exploited, can cause you some serious headaches that are easily avoided.

In the same spirit, I would strongly suggest that before upgrading you review the change logs for all the versions released since OR v3.0.12 (v3.2.7 is current, the version you are using is on page 4.)

http://www.open-realty.org/blog.html

In RE: add-on: Depending on how many custom Agent fields you have setup will determine how difficult any pruning process will be. If you don't have any custom Agent fields setup, and thus haven't been collecting any data, you can possibly prune using an SQL query if you don't mind potentially throwing a few babies out with the bathwater.

FYI, when quoting previous responses, insert your reply outside of the shaded box.

photo Employee
2

This SQL may work for your specific situation and would remove all Agent accounts that are set to active =no. This is pretty broad, and there could be collateral damage if you have inactive Agents who just haven't got around to completing the process. It assumes your DB table names are prefixed with "default_en_" as is typical for an English install of OR

Make a full backup of your OR database first, I have obviously not tested this against your data, and given how potentially devastating this 4-line SQL statement is, anything could happen up to and including sudden hair loss especially if you don't make a backup first.

  1. DELETE UDB, UDBE
  2. FROM default_en_userdb as UDB
  3. INNER JOIN default_en_userdbelements as UDBE ON UDB.userdb_id = UDBE.userdb_id
  4. WHERE UDB.userdb_is_agent = 'yes'
  5. AND UDB.userdb_active ='no';

photo
1

PIV Support wrote:

This SQL may work for your specific situation and would remove all Agent accounts that are set to active =no. This is pretty broad, and there could be collateral damage if you have inactive Agents who just haven't got around to completing the process. It assumes your DB table names are prefixed with "default_en_" as is typical for an English install of OR

Make a full backup of your OR database first, I have obviously not tested this against your data, and given how potentially devastating this 4-line SQL statement is, anything could happen up to and including sudden hair loss especially if you don't make a backup first.

  1. DELETE UDB, UDBE
  2. FROM default_en_userdb as UDB
  3. INNER JOIN default_en_userdbelements as UDBE ON UDB.userdb_id = UDBE.userdb_id
  4. WHERE UDB.userdb_is_agent = 'yes'
  5. AND UDB.userdb_active ='no';
Thank you! Worked like a charm, problem solved!

photo
1

LOL! PIV, what UDBE stand for?

http://acronyms.thefreedictionary.com/UDBE

[]s

photo Employee
1

Eduardo Marques wrote:

LOL! PIV, what UDBE stand for?

http://acronyms.thefreedictionary.com/UDBE

[]s

UserDBElements

Leave Comment

photo

Attach files...

The file must be a jpg, gif, png, bmp, ico, pdf, doc, rtf, txt, zip or rar no more than 20M