Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2013, 08:21 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Usergroup Logging

Hey all! I was wondering if vBulletin logs or stores the dates on which a user's usergroup last changed or anything. The reason is, we have a system where after a user has been inactive for 30 days, they are moved to an inactive status, and they have to request to be moved back to active status. We want the users to be deleted after 30 days in this inactive usergroup, even if they have logged in. Does vBulletin already store the information needed to do this, or does anyone know of an easy way to set a system like this up? Thanks!
Reply With Quote
  #2  
Old 01-02-2013, 09:15 PM
DAMINK DAMINK is offline
 
Join Date: Jun 2010
Location: Melbourne Australia
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is definitely a mod for vb4 that does what you want mate.
Depending on many factors you can move users back and forth between groups.
I cant remember which one it was but there is definitely one there that should fit your needs.
Reply With Quote
  #3  
Old 01-02-2013, 09:23 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On each members profile you will see Profile [View change history] just above the name. Screenshot uploaded so you can see. Not sure if this is what you are after. Seen a few mods that could help try this one
Attached Images
File Type: jpg change history.jpg (123.3 KB, 0 views)
Reply With Quote
  #4  
Old 01-02-2013, 09:45 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, these all do what I already know can be done. The issue is, say people are in usergroup X, the inactive group, I want it to delete accounts based on days in that usergroup, not days inactive.
Reply With Quote
  #5  
Old 01-02-2013, 09:56 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a userchangelog table, and assuming that the user was moved in some way that logs the change (i.e. using the user datamanager), then there will be an entry for that change. I think you could have a plugin that queries to find users that were moved to that group around 30 days ago, and decide if they should be deleted. I think it might be a little tricky because if the user was moved back and forth within the past 30 days, then you might find a record that says they were moved to the invalid group 30 days ago, but they might not be eligible for deletion.

I've been thinking about this because someone else asked about kicking members out of a "publicly joinable" group after a certain amount of time.
Reply With Quote
  #6  
Old 01-02-2013, 10:01 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, this is unfortunately a problem, since we use a mod to move people to our "inactive users" group, and it is not logging that. Hmmm.
Reply With Quote
  #7  
Old 01-02-2013, 10:06 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, yeah, if the mod doesn't use the datamanager, then I think the only thing you could do is change the mod, either use the datamanager or create your own log.
Reply With Quote
  #8  
Old 01-02-2013, 10:12 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't messed to much with altering mods. Is there an article somewhere that details using it or implementing it?
Reply With Quote
  #9  
Old 01-02-2013, 10:29 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think there is an article on using data managers in general (although I can't find it right now - I don't think it has "datamanager" or "data manager" in the title). Anyway, probably the easiest thing would be to find code that does what you want and use that. For changing the user's main group, it would be something like:

Code:
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdata->set_existing($user);
$userdata->set('usergroupid', $newgroupid);
$userdata->save();

where $user is an array that has to contain some of the user's data (at least the userid, I think). There's also an issue with user titles - if changing the usergroup would change the usertitle, then you'd have to do that as well (but I guess if the mod you're using isn't doing that now, then you wouldn't have to worry about it).

You might try asking the mod author about it, in the mod thread (if he or she is still around).
Reply With Quote
  #10  
Old 01-02-2013, 11:20 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. The code doesn't look too complicated, its a mod Paul wrote, so I'll post there. Thanks as always kh99.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:02 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.04288 seconds
  • Memory Usage 2,266KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete