vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Add user with SQL (https://vborg.vbsupport.ru/showthread.php?t=300532)

Tyluur 07-27-2013 09:11 PM

Add user with SQL
 
I am operating a forum for a game and I am removing the vBulletin registration form and making it automated when you first log in.

I am adding the user to user table and generating the password with a small algorithm. The login process is flawless with my registration system.

The only issue is that even though the usergroupid is 2 and the membergroupid is 2 (registered users), they show up as guests! Why is this?

This is my query:
Quote:

.execute("INSERT INTO `vbulletin_user` (`userid`, `usergroupid`, `membergroupids`, `displaygroupid`, `username`, `password`, `passworddate`, `email`, `styleid`, `parentemail`, `homepage`, `icq`, `aim`, `yahoo`, `msn`, `skype`, `showvbcode`, `showbirthday`, `usertitle`, `customtitle`, `joindate`, `daysprune`, `lastvisit`, `lastactivity`, `lastpost`, `lastpostid`, `posts`, `reputation`, `reputationlevelid`, `timezoneoffset`, `pmpopup`, `avatarid`, `avatarrevision`, `profilepicrevision`, `sigpicrevision`, `options`, `birthday`, `birthday_search`, `maxposts`, `startofweek`, `ipaddress`, `referrerid`, `languageid`, `emailstamp`, `threadedmode`, `autosubscribe`, `pmtotal`, `pmunread`, `salt`, `ipoints`, `infractions`, `warnings`, `infractiongroupids`, `infractiongroupid`, `adminoptions`, `profilevisits`, `friendcount`, `friendreqcount`, `vmunreadcount`, `vmmoderatedcount`, `socgroupinvitecount`, `socgroupreqcount`, `pcunreadcount`, `pcmoderatedcount`, `gmmoderatedcount`, `assetposthash`, `fbuserid`, `fbjoindate`, `fbname`, `logintype`, `fbaccesstoken`, `newrepcount`, `bloggroupreqcount`, `showblogcss`) VALUES (NULL, 2, '', 0, '" + name + "', '" + ForumIntegration.passwordToHash(password, getSalt()) + "', '2013-07-26', 'blank@gmail.com', 0, '', '', '', '', '', '', '', 1, 1, 'Junior Member', 0, 1374895770, 0, 1374933245, 1374946433, 0, 0, 0, 10, 5, '-6', 0, 0, 0, 0, 0, 45108423, '08-29-1996', '1996-08-29', -1, -1, '75.170.115.180', 0, 1, 0, 0, -1, 0, 0, '', 0, 0, 0, '', 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, 0, 1);");

Zachery 07-27-2013 09:38 PM

Well, you shouldn't set a membergroup as the primary usergroup, that is just super silly.


You should look at the user DM and pass your data to a script that will use it, instead of running manual sql, because you're not updating the 5 other tables that are required for a user to be a user.

Tyluur 07-27-2013 09:41 PM

Quote:

Originally Posted by Zachery (Post 2435695)
Well, you shouldn't set a membergroup as the primary usergroup, that is just super silly.


You should look at the user DM and pass your data to a script that will use it, instead of running manual sql, because you're not updating the 5 other tables that are required for a user to be a user.

Thank you for your reply! I am not familiar with php, so where do I look, or can you tell me the other 5 tables required to be user?


All times are GMT. The time now is 07:47 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.00907 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_quote_printable
  • (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