Jump to content

vBulletin Integration Coming Soon!


rmccny

Recommended Posts

I've spent the past two days working on a vB user account sync to tie WHMCS and vB together. The biggest challenge so far is that neither vBulletin, nor WHMCS makes doing so very easy, although I do lean in favor of vBulletin since it has a robust hooks system.

 

Anyhow, I've got a system in place that I'm in the process of tweaking and testing that might hopefully work for others. Here's what it does:

 

From WHMCS:

User registers in WHMCS --> Account is created in vBulletin (via CURL using WHMCS actionhook, kind of messy)

User changes info in WHMCS --> Info is sync'd with vB (via include using WHMCS actionhook/Direct MySQL Query)

Admin changes info in WHMCS --> Info is sync'd with vB (very messy, see below/Direct MySQL Query)

 

From vBulletin:

User changes info in vB -- Info is sync'd with WHMCS (via Hook/Direct MySQL Query)

Admin changes info in vB -- Info is sync'd with WHMCS (via Hook/Direct MySQL Query)

 

Fields Sync'd:

E-Mail (2-Way)

Password (2-Way)

Birthdate (If you create custom fields in WHMCS, 2-Way)

Gender (If you create custom fields in WHMCS & vBulletin, 2-Way)

Location (vB custom field, one-way population from client city/state during account creation)

 

This integration also will allow the client to choose their username during the signup process.

 

The vBulletin Hooks DO NOT use the WHMCS API. I have found it to be a bit sluggish on my system for some reason so I chose to directly manipulate the WHMCS database for the few fields I touch.

 

I won't be developing any reverse account creation, I'd rather force all registration through WHMCS so I have disabled registrations on my forum.

 

Why is "Admin changes info in WHMCS" very messy? Well, there are no actionhooks called when an admin makes changes to a client profile for whatever reason. So basically what I had to do is create a landing point for submissions from admin/clientsprofile.php to handle the updates.

 

Why is "User registers in WHMCS" kind of messy? For the same reason as above. I decided NOT to use a custom field for the forum username since you cannot easily make a custom WHMCS field non-editable after registration. This mod will post the register.php form to a different file first before passing it onto register.php. This allows for forum username availability checks before handing off to WHMCS.

 

It is also possible to do single sign-on for both as well, but I will need to work with Matt for that since it requires access to the code.

 

I'm in the process of testing now. My forum is not live yet, so I have the ability to break it as much as needed. I'm posting ahead of the release to gauge interest, and also see who wants to help test this before a general release.

 

Thanks.

Link to comment
Share on other sites

  • WHMCS CEO

I think you might want to check the admin changes info in WHMCS again. There is an action hook run - it's the same one as run when a client changes info - called ClientDetailsEdit. Likewise when a user registers, the ClientSignup hook is run.

 

Matt

Link to comment
Share on other sites

Matt, I'll go back and retest the hook call from admin to see if I missed anything.

 

Also, sent you a PM about some other stuff.

 

Goddess,

I just have to put the finishing touches on the initial sync script and it'll be ready for testing.

Link to comment
Share on other sites

Update: I replaced my actionhooks.php with a fresh one and it is now being called correctly without having to relay through a handler.

 

Not sure what changed, since I was always calling the save handler as an external include from actionhooks.php, but who cares, it's working now.

Link to comment
Share on other sites

Why is "User registers in WHMCS" kind of messy? For the same reason as above. I decided NOT to use a custom field for the forum username since you cannot easily make a custom WHMCS field non-editable after registration.

 

We've "fudged" pending (hopefully/eventually) WHMCS adding a new "client-editable" variation to tblcustomfields for times you want the client (or admin) to specify on the orderform, but not change in the clientarea, or to tell them details of things like serial numbers and not let them change it ...

 

For some we have 2 fields one of whch is admin only in the tbl and another which is normal, copying the data between them at signup and then a cron job to compare them and reset back every day - for things like their VAT number, where we *might* want them to update it but need to know they have done so - the client detail update email including custom fields woudl fix that ...

 

And for other things in the client area setting it to .value not .input for that customfield-id - sadly this means 160 if statements in various tpl's :(

Link to comment
Share on other sites

I'm currently re-working the sync to work as an add-on module in WHMCS admin. The inital Sync will be WHMCS --> vBulletin. There is no way to do the reverse since vB passwords are stored using 1-way encryption. I'm also adding a manual account assignment option too. I'm waiting to hear back from Matt with answers to a couple questions before I attempt any kind of release.

 

Othello, I too wish the WHMCS custom fields had the functionality that vBulletins do. There are so many things I've had to hack together either with php code in templates, or wrappers for stock files. Don't get me wrong, it's an awesome product, but the two big suggestions I would make would be to enhance the custom fields and expand the hooks system to include more hook points.

Link to comment
Share on other sites

Here's an update...

 

Additions:

Added WHMCS actionhook for DeleteClient called via CURL (must be to properly initialize vBulletin). When a client gets deleted in WHMCS the linked vBulletin account can be automatically deleted as well. This feature can be disabled.

 

vBLink Sync: The WHMCS to vBulletin Sync Tool

This is pretty much complete and is built as a WHMCS admin module. This utility is only run once, when the bridge has been installed (it can be periodically run however, if you continue to allow forum registration). If it can't find a matching e-mail address in the vB database it will create a new vB user with the first part of the clients e-mail address as the username. If a matching e-mail address is found then the vB user is linked to the corresponding WHMCS account.

 

The sync tool will also automatically add the required column in the vBulletin database for associating clients. The manual account link tool is also finished, as is a "Trial Sync" feature which goes through the motions of syncing without actually making changes.

 

This should be finished and ready to go within a day.

Link to comment
Share on other sites

I have thought about doing this myself, but since someone else is (yay!) let me suggest an option I would like to see:

 

First and Last name used instead of first portion of email address as the vbulletin username. I'd just as soon have everyone use their real names on our forum, (well if and when we put a forum up, that is, which is if and when WHMCS integration becomes available.)

Link to comment
Share on other sites

Troy, excellent suggestion, and one I decided to take. I have added the ability to choose how usernames are generated in both the sync tool, and new user signup stage, as well as a few different ways to assemble the clients name into a username.

 

I'm the the process of packaging the add-on at the moment.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated