vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Managing members waiting for email confirmation (https://vborg.vbsupport.ru/showthread.php?t=317186)

giaguaro 02-06-2015 09:36 AM

Managing members waiting for email confirmation
 
due to spam problems, i have set "on" both CAPTCHA, moderation of new users and email confirmation.
Now i have to manage a 16.000 users list.
I would like to manage that in a confortable way, such erasing all the users with a specified email server and so on.
Nowaday, the best function in admin panel is "erase/move members" and i have to check every members.
I dont want to cancel everyone without checking if they are real or not..
Anyone has suggestion on a mod?
Thanks a lot

kh99 02-06-2015 10:14 AM

I don't know of a mod, but I have a suggestion: create a usergroup for users to be deleted. Then use a query to move users to that group, like maybe:
Code:

UPDATE user SET usergroupid=X WHERE usergroupid=4 AND email LIKE %hotmail.com%
(usergroupid=4 means users awaiting moderation). You'd replace the X with the usergroupid you created. You can do this multiple times if you have more than one email provider you want to exclude.

Then use Move/Prune users to delete users in usergroupid X.

The safe thing to do would be to have a backup before making any changes directly to the database.

giaguaro 02-06-2015 10:40 AM

this could be great!
But please: where the query must be opened?
I mean, i have to put your code in a file?

Dave 02-06-2015 10:42 AM

You either execute it in something such as PHPMyAdmin or at AdminCP > Maintenance > Execute SQL Query.

giaguaro 02-06-2015 10:50 AM

so, i execute the query and i will find a new members group, with the members awaiting email confirmation speficied in the query?

--------------- Added [DATE]1423227234[/DATE] at [TIME]1423227234[/TIME] ---------------

well, i need the ID of the group "users awaiting email confirmation" to tell the truth

kh99 02-06-2015 10:55 AM

Well, you would first have to go to the usergroup manager and add a new user group. You could use "Create Usergroup Based off of Usergroup"... and select Users Awaiting Moderaton, so that the new usergroup won't have any more permissions. Then note the usergroupid of the group you create and use that in the query.

SaN-DeeP 02-06-2015 10:58 AM

Thanks kh99,
Yet another handy query..

kh99 02-06-2015 11:00 AM

Quote:

Originally Posted by giaguaro (Post 2536429)
well, i need the ID of the group "users awaiting email confirmation" to tell the truth

Using a query to change the database directly can be dangerous. It might be best not to use this method if you don't feel confident about it, because you don't want to accidentally delete any of your legitimate users.

giaguaro 02-06-2015 11:01 AM

I did mean i dont need usergroup 4 but the id of the "users awaiting email confirmation" group

Quote:

Originally Posted by kh99 (Post 2536426)
(omissis)

(usergroupid=4 means users awaiting moderation). You'd replace the X with the usergroupid you created. You can do this multiple times if you have more than one email provider you want to exclude. (omissis)

--------------- Added [DATE]1423227773[/DATE] at [TIME]1423227773[/TIME] ---------------

oh sorry i see i have the ID on the admin panel!

--------------- Added [DATE]1423228369[/DATE] at [TIME]1423228369[/TIME] ---------------

great. My admincp says i am not allowed to launch sql query :(
I am superadmin, dont know why

kh99 02-06-2015 11:15 AM

Quote:

Originally Posted by giaguaro (Post 2536435)
great. My admincp says i am not allowed to launch sql query :(
I am superadmin, dont know why


You need to list your userid in the config.php file as a user who can run queries. Look for this
Code:

$config['SpecialUsers']['canrunqueries'] = '';

and add your userid between the quotes.

giaguaro 02-06-2015 11:21 AM

thanks a lot again. I am really a beginner.. and i am italian :p

kh99 02-06-2015 04:10 PM

Quote:

Originally Posted by giaguaro (Post 2536429)
well, i need the ID of the group "users awaiting email confirmation" to tell the truth


I misunderstood this. "users awaiting email confirmation" is different than "users awaiting moderation". And I see you found the id in the admincp. Sorry, I thought you were confused, but it was me. :o

giaguaro 02-07-2015 12:55 PM

lol as i told you i am definitely a beginner and have a poor english.

Now:
UPDATE user SET usergroupid=eliminare WHERE usergroupid=3 AND email LIKE %sina.com%

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%sina.com%' at line 1

what happened?

kh99 02-07-2015 01:01 PM

Quote:

Originally Posted by giaguaro (Post 2536531)
lol as i told you i am definitely a beginner and have a poor english.

Now:
UPDATE user SET usergroupid=eliminare WHERE usergroupid=3 AND email LIKE %sina.com%

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%sina.com%' at line 1

what happened?

Sorry, that's my fault. You need that in quotes, like:
Code:

UPDATE user SET usergroupid=eliminare WHERE usergroupid=3 AND email LIKE '%sina.com%'
But also, you can't have 'eliminare' there, because the usergroupid must be a number.

giaguaro 02-07-2015 01:45 PM

great! It worked.
Now i will want to go deeper...
Can i state something like "move all gmail.com account with more than 3 dots in the address"?

--------------- Added [DATE]1423324121[/DATE] at [TIME]1423324121[/TIME] ---------------

or like "everything with .pl suffix"?

kh99 02-07-2015 01:54 PM

So, 3 or more dots other than the one in 'gmail.com'? Maybe this:

Code:

SELECT username FROM user WHERE email LIKE '%.%.%.%gmail.com'

and this
Code:

SELECT username FROM user WHERE email LIKE '%.pl'

To be honest I'm not sure if trailing spaces are removed from emails addresses or not, so I don't know if you need a trailing '%'.

giaguaro 02-07-2015 02:11 PM

well this work great for registered users.
Will it work also for the quert in user awaiting email confirmation?

One more problem: it doesnt let me erase the users in the new group i created :( ("eliminare")

kh99 02-07-2015 02:14 PM

Quote:

Originally Posted by giaguaro (Post 2536554)
well this work great for registered users.
Will it work also for the quert in user awaiting email confirmation?

You just need to add "AND usergroupid=3" to the end.


Quote:

One more problem: it doesnt let me erase the users in the new group i created :( ("eliminare")
What are you trying to do exactly?

giaguaro 02-07-2015 02:18 PM

i go to the erase/move users in the admincp, choose "eliminare" , it list about 5000 users, i flag them all but when i flag "erase" it says "action specified is not valid" and go back to the panel

--------------- Added [DATE]1423326747[/DATE] at [TIME]1423326747[/TIME] ---------------

well to tell the truth it doesnt allow me to move or erase the members of the group i created

kh99 02-07-2015 02:38 PM

Maybe it's too many to delete at one time. Maybe you can use the 'Join Date is Before' to try to select fewer at a time.

giaguaro 02-08-2015 09:59 AM

thanks it worked :) less users, everything ok!

giaguaro 01-24-2021 04:21 PM

that did work again.. so i want to thanks again for the help!

--------------- Added [DATE]1611529439[/DATE] at [TIME]1611529439[/TIME] ---------------

a new request: code to erase directly from query php? thanks in advance


All times are GMT. The time now is 05:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01215 seconds
  • Memory Usage 1,764KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete