13

Xenforo Integration

DAP integrates with Xenforo, vBulletin, and several other free WP plugins like BBPress, SimplePress, Buddypress, Mingle etc.

The integration with free WP forum plugins is not at product/member level but you can set up DAP to ONLY allow registered or paid members to POST to the forums.

But if you use paid plugins like Xenforo and VBulletin, you can control access at membership level. You can restrict forum access based on user’s membership level in DAP.

There was just 1 limitation with the DAP=>Xenforo integration and that was with Automatic Login’. But we have eliminated that limitation in DAP 4.7.

If you are on older version of DAP (DAP 4.6.2 or below), then DAP cannot auto-login the users to the forum when they login to DAP.

But if you upgrade to DAP 4.7 (or above), DAP can not only control forum access at membership level but DAP can also autologin users to the forum when they login to DAP.

Here’s the steps to setup the integration :

STEP 1:

Install Xenforo forum.
Say it is installed under http://YOURSITE.com/community

STEP 2: 

Follow these instructions to integrate Xenforo ONLY if you are on DAP 4.7 or above.

1. FTP to your site. You will find a file called api.php under /dap/plugins/dap_xenapi folder.
Upload the api.php file to your forums folder. If you installed forum under /community, then upload api.php to that folder.

2. Generate a hash by using an online service, like http://www.miraclesalad.com/webtools/md5.php

3. Set an API key for XenAPI, this can be done by editing the `api.php` file and replacing the `API_KEY` string with the hash generated in step 2.

$options = array(‘api_key’ => ‘set this to the hash generated in step 2 above’);

Follow these instructions to integrate Xenforo ONLY if you are on DAP 4.6.2 or below (SKIP 1-6 below if you are on DAP 4.7 or above).

1. Download XenAPI for Xenforo from the GitHub repository:
https://github.com/Contex/XenAPI/archive/master.zip

2. Open the downloaded ZIP archive and extract the contents of the zip file to your desktop.

3. Upload `/XenAPI-master/net/xenapi/XenAPI/api.php` to the root directory of your XenForo installation. So if the installation is under /forum folder, upload api.php to the forum folder.

4. Generate a hash by using an online service, like http://www.miraclesalad.com/webtools/md5.php

5. Set an API key for XenAPI, this can be done by editing the `api.php` file and replacing the `API_KEY` string with
the hash generated in step 4.

$options = array(‘api_key’ => ‘set this to the hash generated in step 4 above’);

6. Upload `/XenAPI-master/net/xenapi/XenAPI/examples/dap/plugins/dap_xenapi/dap_xenapi.class.php` to
`/dap/plugins/dap_xenapi/` of your DAP installation.

STEP 3:

1. a. Login to your XenForo Admin panel and go to user groups, `Users -> User Groups -> List User Groups`.
1. b. Find the group you wish the user to be assigned to when they register.
21 c. Note the ID of the group, we’ll use it later, `admin.php?user-groups/example-group.6/edit`, 6 is the group ID.

2. We now need to create the string that is going to be sent to DAP XenForo Plugin.

Here’s the the string that is sent to DAP XenForo Plugin:
dap_xenapi:API_KEY:PROTOCOL:API_LOCATION:GROUP_ID

a. `API_KEY` should be replaced with the md5 hash you generated in STEP 2.
Example API_KEY: a5b2b1f2mc1mas2f3
b. `PROTOCOL` should be replaced with which protocol you wish to use, current options are only `http` and `https`.
Please note that if you use `http`, the password of the user will be sent over a unecrypted protocol.
Example PROTOCOL: https
c. `API_LOCATION` should be replaced with the location of XenAPI’s file, `api.php`, which you should now have in the
root directory of your XenForo installation. Make sure you do NOT include the `http` of the URL.
Example API_LOCATION: YOURSITE.com/forum/api.php
d. `GROUP_ID` should be replaced with the group ID you wish the user to be assigned to when they are added to a product in dap, this is the group ID you
found in step 7.

If you wish not to assign the user to a group, you can remove this parameter or set it to `0`.
Example GROUP_ID: 6
Example GRPOU_ID: 0
Example:

a. Register the user AND assign the user to a specific group: `dap_xenapi:a5b2b1f2mc1mas2f3:https:example.com/forum/api.php:6`.

b. Register the user AND assign the user to a specific group AND use a custom field identifier: `dap_xenapi:a5b2b1f2mc1mas2f3:https:example.com/forum/api.php:6:unique_user`.

3. Open your DAP admin dashboard and go to Products/Levels -> Manage page.

4. Find the product you wish to integrate XenForo with, click on the `Notifications` tab.

5. Add the string you created in step 8 to the `Plugin Notification upon User “Add”`
and `Plugin Notification upon User “Add”` fields.

PLEASE NOTE: The only part that will change from product to product is the ‘group id’ (the last field).
The group id is the id of the usergroup in the forum that the user should get access to when they signup for a dap product.
If you create your own usergroup in xenforo, you can set the usergroup id of that in the group id field.
Now when a user registers to a product in dap, they will automatically be added to the specified usergroup id and thus will have the same ‘permission’ to the forum that the specified usergroup id is set to have.
Each product in dap can be configured to add the user to a different usergroup in forum if you want each product/level to have different forum permission.

STEP 4:

FTP to your site, find dap-config.php file under the dap folder, edit it and add this to your /dap/dap-config.php file.

Add it towards the top after php start tag (<?php) :

define(‘XENFOROFORUMPATH’, ‘/home/crespond/yoursite.com/community’); // path to your Xenforo forum

VERY IMPORTANT: Remove all occurrences of  backticks (`) in the line above and replace it with single or double quote.

NOTE:

If you want to find the path to the Xenforo forum on your site, you can visit this page: http://yoursite.com/dap/getpath.php in a browser.  It will give you the path to the “dap” folder on your site. Just remove the /dap from the end of the path and instead append /community (or whatever is the name of your forums folder) to it.

Now upload dap-config.php file back to the dap folder on your site.

STEP 5:

Testing:
1) Add a user to the product integrated with xenforo using the dap admin -> add users page.

2) Login to your xenforo admin dashboard on your site and you can search for this new user and find the user in xenforo

Please Note:

Current integration limitation with xenforo is that if a user logs in to dap, they will not be auto-logged in to xenforo.

You can send the users their xenforo login in the welcome email. They can login to xenforo using their dap email id and dap password.

But if they change their dap account password, it will not get sync’d to Xenforo.

Users can change the xenforo password directly in xenforo if they want it to match dap password Or they can continue to use their old password to login to xenforo.

This is a limitation for now but we will address it in a few months from now.

 

Click Here to Leave a Comment Below 13 comments
Chris - April 25, 2014

This is great. Can’t wait for the auto-log and password sync updates. You guys are great!

Reply
Colin - September 8, 2014

Hi, just about to start cracking with this instead of vbulletin.

Is integration with DAP regarding when a member logs in to the membership area of a member site, will they be automatically logged in to the forum?

Can there be different levels of forum, meaning… Can a member have full access to the forum, a blog visitor have free access to certain parts of the forum and then they can decide to either pay for just premium forum content or pay the membership site fee and get the forum access as part of that?

Also, can the forum software be on a sub directory of a main blog (to help with link juice/SEO?) and DAP on a sub domain or do they both have to be on a sub domain (DAP can’t install to a sub directory.)

Cheers for now,

Colin.

Reply
Veena Prashanth - September 9, 2014

Hi Colin,

>> Is integration with DAP regarding when a member logs in to the membership area of a member site, will they be automatically logged in to the forum? < < Currently the users do not get logged in automatically but looks like there is a way to do this. We will be happy to work with you to try and get the automated login working with Xenforo. >> Can there be different levels of forum, meaning… Can a member have full access to the forum, a blog visitor have free access to certain parts of the forum and then they can decide to either pay for just premium forum content or pay the membership site fee and get the forum access as part of that? << Yes, members can have different levels of forum access. You can control forum access based on user's membership level (product access) in DAP. Thanks, Veena

Reply
Todd Janca - September 10, 2014

Hi Veena,

Is this going to happen? I was just about to buy vbulletin because there was no DAP single sign on / auto login for Xenforo.

If this is going to work soon / or is working let me know and i will go with Xenforo.

Thanks!

Reply
ANHPHAM - October 21, 2014

Is integration with DAP regarding when a member logs in to the membership area of a member site, will they be automatically logged in to the forum?

THIS IS MY QUESTION AS WELL, PLEASE DO IT, i NEED IT ASAP. THANKSSSSSSSSSS

Reply
Veena Prashanth - October 21, 2014

Hi Todd,

>Is this going to happen? I was just about to buy vbulletin because there was no DAP single sign on / auto login for Xenforo. If this is going to work soon / or is working let me know and i will go with Xenforo. << Yes, DAP can now auto-login users to Xenforo when they login to DAP. We recommend using Xenforo over VBulletin because integration with Xenforo works better than VB integration. Thanks, Veena

Reply
Veena Prashanth - October 21, 2014

>>Is integration with DAP regarding when a member logs in to the membership area of a member site, will they be automatically logged in to the forum?<< Correct. The users will be automatically logged in to Xenforo when they login to DAP. Thanks, Veena

Reply
Anh Pham - October 22, 2014

Hi,

I’m running this webiste http://graffsociety.com with over 500 members, now I added Xenforo forum to my website, HOW CAN USERS LOG IN TO MY WEBSITE THEN THEY WILL BE LOGGED IN TO XENFORO AUTOMATICALLY? PLEASE TELL ME THE DETAILS, THANKS

Reply
Veena Prashanth - October 22, 2014

Please follow the steps in this post for Xenforo integration. DAP will automatically login members to Xenforo when they login to DAP.

You need to be on DAP 4.7 (we released the beta version today) for the autologin to work.

Thanks,
Veena

Reply
Heather Claus - January 12, 2015

With this login, can I protect/drip forum threads as well?

For example, if there are 40 threads, can I drip the lesson and the discussion thread that goes with it each day?

Reply
Veena Prashanth - January 12, 2015

>>With this login, can I protect/drip forum threads as well? << No, it will not work. The content dripping in DAP will not work for forum content. Thanks, Veena

Reply
Eduardo - February 9, 2015

I have a litle problem here with this step
define(‘XENFOROFORUMPATH’, ‘/home/crespond/yoursite.com/community’); // path to your Xenforo forum,
VERY IMPORTANT: Remove all occurrences of backticks (`) in the line above and replace it with single or double quote.

Can you put the line like is correct with Remove all occurrences of backticks? Y try many many times but eith error
is litle confuse to me

and other thing free members what register form singup form no register in forum.
Thanks for you time Edwuard.

Reply
Veena Prashanth - February 9, 2015

Hi Eduardo,

Please open a support ticket (http://digitalaccesspass.com/support) and we will take a look.

Thanks,
Veena

Reply

Leave a Reply: