PDA

View Full Version : Adding Users via a Back Door Script? - Users Added fine, but not recognized!


donjames
08-20-2002, 11:53 PM
Hi,

I'm designing a site for a client and the site already requires users to register for certain features. Now - we don't want them to register again to access vBulletin (so as to keep usernames/passwords the same). So, I've added code to the registration script I already had (not the vBulletin registration script) so that when a user registers, he is automatically added to the user table for vbulletin.

That all works fine - BUT - when the user who has been added this way tries to login to vBulletin, it initially recognizes them, but when about to display the list of forums, it gives an error:

"There seems to have been a slight problem with the NRCCM Forums database.
Please try again by pressing the refresh button in your browser."

It works fine if I login myself since I initially registered via the vBulletin registration script (so as to be the Administrator). But when logging in users added the other way - it won't display the forums.

When checking the user table, all the entries are there, and the values seem to be okay. The number of users in each user group are also displayed fine in the Administration Control Panel - under Modify User Groups. But when I go to list the users in a particular group, it doesn't find any.

Can anyone give me an idea as to why this might be happening. I haven't changed ANY code in vBulletin - all I've done is add users to the MySQL user table.

Is there a particular field that might not be set or is there another table that might have to be updated after adding members this way?

The insert statement I am using is like the statement below only some of the values change: (note that when adding the password, I first encrypt it using the same command vBulletin does: md5($password))

INSERT INTO user
(usergroupid, username, password, email, styleid, parentemail, coppauser, homepage, icq, aim, yahoo, signature, adminemail, showemail, invisible, usertitle, customtitle, joindate, cookieuser, daysprune, lastvisit, lastactivity, lastpost, posts, timezoneoffset, emailnotification, buddylist, ignorelist, pmfolders, receivepm, emailonpm, pmpopup, avatarid, options, birthday, maxposts, startofweek, ipaddress, referrerid, nosessionhash, inforum)
VALUES (2, 'test', 'ff0680754d57409ca47143f1c01c5320', 'test@hostworthy.biz', 2, '', 0, '', '', '', '', '', 1, 0, 0, 'Junior Member', 0, time(), 1, -1, time(), time(), 0, 0, '-5', 1, '', '', '', 1, 1, 0, 0, 15, '0000-00-00', -1, 1, '', 0, 0, 0);

It seems to add users fine - the problem is vBulletin doesn't recognize these though it counts them correctly.

Any help would be appreciated!
;)

Xenon
08-21-2002, 03:54 PM
you must also add users to the userfield table :)

eXtremeTim
08-21-2002, 07:19 PM
And make sure its setting there groupid.

Link14716
08-22-2002, 12:17 AM
It's all userfield table.

If they're not in the userfield table, you can't edit them in the admin CP not can you see them on the memberlist. Learned that the hard way. ;)

donjames
08-22-2002, 01:07 AM
Thanks everyone - it works now :classic: