View Single Post
  #1  
Old 02-26-2005, 02:29 AM
ram2600 ram2600 is offline
 
Join Date: Jan 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom Registration / User Duplication

Hi,

Here is a quick overview of how we ae using vB. Our main site is <SITE>.com, this is where we have a wealth of user data, to avoid the users from recreating this data in Vb We disabled the registration sectio of vB. I them create a script that is run when a new user activates his gamertag account, and this place the user in the Needed vB Tables (well that we beleive) I will put the php inserts at the bottom.

I am adding info the following tables; user, usertext, and usertextfield. This allowed for the user to apper correctly in the admincp.

The users are able to log in fine, but I have seen duplicate users being created in the usertable, I have been investigatiing my scripts but they run only once on activation for that user and never again.

today I cleand up all the dupes so the database was consistant, but all new users and users that have not logged in in a while, those with I am guessing the lastactiviy date of 1969, seem to duplicate them selvesafter logging into vB. (stilll a guess on that db field or the reason)

I am trying to determin if during logon to vB have I missed some data on the inserts and the login code creates a new user. The record is usually the same, excpet for the date fields and the salt value, we use a constant salt for all users, and that is not present on the dupes.

Any thoughts or help would be appreciated.

Thank you
-Ralph

------php inserts----
user table
$forumFields = "usergroupid, username, password, salt, passworddate, joindate, lastvisit, lastactivity, email, homepage, options, importuserid ";
$forumValues = " 2, '$gamertag', '$password','$gtsalt' ,UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now()), '$email', '$url', 6167, $id ";
$forumUserSQL = sprintf("INSERT INTO user (%s) VALUES (%s);", $forumFields, $forumValues);

---------------------
userfields and usertext field.

$forumGetID = sprintf("Select userid from user where username = '%s';", $gamertag);
if (mysql_query($forumUserSQL, $remoteForums)) {
$rsID = mysql_query($forumGetID, $remoteForums);
$vbIDForActivation = mysql_fetch_assoc($rsID);
if ($blnTesting) echo "[ActivateForumUser]: We Have Connection - proceed<br>";

//insert into userfield
$forumUserfield = sprintf("INSERT INTO userfield (userid) VALUES (%s);", $vbIDForActivation['userid']) ;
//insert into usertextrield
$forumUsertextfield = sprintf("INSERT INTO usertextfield (userid) VALUES (%s);", $vbIDForActivation['userid']) ;

mysql_query($forumUserfield, $remoteForums);
mysql_query($forumUsertextfield, $remoteForums);
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01265 seconds
  • Memory Usage 1,766KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (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_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete