README/USAGE - vbulletin-bridge - 10/16/09
------------------------------------------
class vBulletin-Bridge - intended to be used with vBulletin 3.7.2
Based on snippet by Alex Matulich, June 2008, Unicorn Research
Corporation released under BSD. Major modifications made by
Sam Cleaver (Beaver6813.com), Sept 2009,
[email protected].
------------------------------------------
FULL LIST OF FUNCTIONS AVAILABLE FOR USE:
- register_newuser (Registers new user and sends out activation email unless
$noactivate is set to true)
- activate_user (Activates user)
- deactivate_user (Deactivates & Deletes user)
- requestact_user (Requests new activation email)
- request_password (Requests lost password email)
- check_password_request (Verifies lost password info)
- change_password (Changes the users password)
- update_user (Updates specified user information)
- delete_user (Hard deletes user (not reccomended))
- login (Logs in user)
- logout (Logs out user)
------------------------------------------
CONFIGURATION
Minimal configuration is needed, see INSTALL
------------------------------------------
USAGE
At the top of your php modules where you need to perform vBulletin
user operations (creation, deletion, updating, login, and logout),
put these two lines (where MY_PATH is the path to this file):
require_once(MY_PATH.'/class.vbulletin-bridge.php');
$forum = new vBulletin_Bridge();
Now get your user data array from $_POST or whatever. Let's call
this array $userdata. Here's what you can do:
CREATE AND REGISTER NEW USER:
$errmsg = $forum->register_newuser($userdata);
UPDATE EXISTING USER DATA:
$errmsg = $forum->update_user($userdata);
(In this case, $userdata need contain only the username and anything
else you wish to update, such as password and/or email address.)
$errmsg contains any error messages separated by <br> codes.
If no errors occured then NULL is returned.
DELETE USER:
$forum->delete_user($username); $username = user name
LOGIN USER TO THE FORUM:
$forum->login( requires array to be passed
array('username' => $username, 'password' => $pw);
LOG OFF USER FROM THE FORUM:
$forum->logout();
WARNING: It is common for you to have TABLE_PREFIX defined for
your own database. You must call it something else (for example,
remove the underscore) or it will conflict with the vBulletin
definition of the same name.