The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Add new Users (automatically)
As this is a common request for integration purposes, I thought I should write up another HowTo If you want to add a new user to the vBulletin database, you can use Class vB_Datamanager_User. This Calss does make sure that everything is OK, it will also take care of the default registration options. Example PHP Code:
PHP Code:
If everything is OK PHP Code:
You can also set many other info too:
Besides that, you can also set the options Bitfield (Receive Admin PMs, etc.) PHP Code:
Value must be 0 or 1 (false or true), depending if you want to set the option or not. If the Options are not set, the Default Registration Options/Board Default Options will be used. Important Notice It is assumed that you are using this code from 'within' vBulletin, eg with the vBulletin backend loaded. If this is not the case, you must include smth. like the following code in global context: PHP Code:
This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent. |
#52
|
|||
|
|||
i dont know how do it?
let c what i can understand first creat vB_Datamanager_User.php file then put this code and upload to vb folder in your site then ask this http://yoursite/vb/vB_Datamanager_User.php it just registerd 1 user??? and i should change username and email again and reupload??? how it does automatically??? can any one help me how do this plz |
#53
|
|||
|
|||
Hi everybody,
is it also possible to pass a simple URL to a script, which takes the variables from the URL and registers the new user? The problem is, that i dont have the possibility to send something else... the only thing i can do for my project is sending an URL... will it be possible? |
#54
|
|||
|
|||
Is it possible to use this and pass in a password that is already an md5 hash?
for example: $userdm->set('password', "5f0f8c991d3d31c63ab531916c298c65"); |
#55
|
|||
|
|||
plz some 1 tell me how do that?
|
#56
|
|||
|
|||
Quote:
I will also have to use the modified method above since I cant install curl on my host. I cant belive this isnt made easyier (for external sign ups) Quote:
How can you have globals.php in your script root for a 2nd host/server/url, unless its coppied over, or the registration code is also in the root of forum. Hmm, Ill look into this! |
#57
|
|||
|
|||
This is making driving me batty... With the "save" line commented, no errors are found. When I uncomment it, the data gets saved, BUT the error message line executes as if the entire program reruns itself. The 2 errors generated are duplicate username and duplicate email. Anyone have any ideas?
Code:
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); $userdata->adminoverride = true; $userdata->set('username', 'phpNukeUser'); $userdata->set('email', 'foo@bar.com'); $userdata->set('password', 'verysecret'); $userdata->set('usergroupid', 500); $userdata->set('usertitle','Tourist'); if(count($userdata->errors)) { echo "<b>".count($userdata->errors) . " errors </b>"; } else { // $uid = $userdata->save(); echo "<br/>User " . $uid . " added."; } |
#58
|
|||
|
|||
My God - the curl thing worked. It took me all week to find this post. Thanks.
|
#59
|
|||
|
|||
Novastar's script worked beautifully on the first try!
Thanks dude. |
#60
|
|||
|
|||
anyone having trouble with new users not getting a welcome post via datamanager, no idea how to make sure new users get a welcome post, there must be a way
|
#61
|
|||
|
|||
When I use any variations of the scripts (with cURL and without) in this thread, I get these errors:
Notice: Undefined index: HTTPS in /var/www/html/includes/class_core.php on line 1599 Notice: Undefined index: HTTPS in /var/www/html/includes/class_core.php on line 1599 Notice: Undefined index: HTTP_REFERER in /var/www/html/includes/class_core.php on line 1626 I'm using VB 3.6.7 -- has something changed in this version that might be causing this? Is there another file I need to include to get the environment set up right? I see where these indices are used in class_core.php, but I haven't (yet) found where they are defined. Still looking ... Any suggestions would be appreciated. Thanks, Ron. Okay, I'm not thinking straight. Of course, php sets the $_Server superglobal. SO, I guess my job is to find out why the HTTPS and HTTP_REFERER values are not being set. Thanks, Ron. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|