vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Auto Delete users in group after 45 days (https://vborg.vbsupport.ru/showthread.php?t=67673)

hurrican 07-26-2004 11:30 PM

Auto Delete users in group after 45 days
 
I am looking to delete my users who sit in the "Awaiting E-Mail Confirmation" Group for more than 30-45 days. I found a cron job that will delete inactive users, but i'm not quite smart enough to figure out how to make it delete users only in a certain usergroup if in that group for 45 days.. Would this be the script that I'd need to run?? Any help would be GREATLY Appreciated by you SQL gurus :)


PHP Code:

<? 
//Delete non-activated members after 45 days 

require ("./global.php"); 

$DB_site->query ("DELETE FROM user WHERE  joindate > '".(time() - 3888000)."' AND usergroup=2"); 

?>


Andreas 07-26-2004 11:37 PM

AFAIK there is no timestamp when a users becomes member of a usergroup, so this might be tricky ...

hurrican 07-27-2004 12:20 AM

Thanks Kirby,
Duh to me :) lol.. I had forgotten about that.. How about something like this?

If a user registered 45 days ago, and is still awaiting email confirmation, and has 0 posts, the 46th day, their account will be deleted. This should solve the problem of having accidentally deleted 'normal' users who might have merely changed their e-mail address where we can manually find out what their problem is. This would cause only those new members (who I don't allow to post while awaiting confirmation) with 0 posts to be eliminated from my database.

Is a query like this possible?

pran 08-18-2004 04:38 PM

I'm also interested to see this cron job. I have more than 100 users waiting for confirmation and it puts additional load on the server to send 100 e-mails just to remind them to activate their account.


All times are GMT. The time now is 03:35 AM.

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.00918 seconds
  • Memory Usage 1,711KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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