vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Best way to run recurring command for every user (https://vborg.vbsupport.ru/showthread.php?t=310289)

Rami114 04-07-2014 01:44 PM

Best way to run recurring command for every user
 
I have a standard vb4 forum to which I'm now trying to add external API verification into the registration. This is game related.

I've added 4 custom profile fields, two to do with the api lookup itself (which the user must provide at registration time) and 2 for me to keep track of api lookup and api reported membership.

When a user registers, I make the API call with the provided details and check that a game user is returned who matches the supplied username (well multiple game chars might be returned by I check for the username). If that checks out the user is created.

Additionally, I want to grant a group membership based on a secondary piece of information I get from the game API (in-game guild name). I.e. if their guild name is ours, I give them member level access.

I've got some test code up and running to talk to the API, and I've been digging into the VB code itself to get a feel for it. At the moment I'm looking at modifying the registration code. That's the situation as I stand (in case anyone goes 'OMG don't do it that way! Do X!).

The main question is, what's the best way to run a cronjob that goes over every user, checks their API details are still valid and, where needed, updates membership. I quite like data managers, but they are only valid in the current user context and I'd really want to run this for every user.

Is this the best approach, should I do this differently?

Thanks in advance,

Rami

ForceHSS 04-07-2014 03:05 PM

Cron job is ok but a custom plugin might also be needed

Rami114 04-09-2014 08:59 AM

Basically I ended up doing this by writing my own set of functions that talks straight to the DB. Fortunately local scripts can run in the VB context by including global (without incurring some odd no-user-defined error).

Data managers are great, but I'm still working out how to force some of them to work for a specific user.


All times are GMT. The time now is 07:09 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.01067 seconds
  • Memory Usage 1,708KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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