This is a very simple plugin, but I'm sure would help bridge the gap for anyone considering using Xenforo for their website. This plugin is designed to work alongside your existing permissions plugin, and executing commands so that your Xenforo ranks are synced up with your Bukkit/Spigot server ranks.
The plugin is made out of one config file, as so:
The above getGroups command is for Xenforo 1.1.x. Use this if you are using Xenforo 1.2.x:Code (Text):mysql: //Insert your xenforo database details
host: localhost
database: xenforo
username: user
password: password
//Change the 'Minecraft' part to whatever custom field ID you set. (case-sensitive)
getGroups: SELECT user_group_id, secondary_group_ids FROM xf_user WHERE user_id = (SELECT user_id FROM xf_user_field_value WHERE field_id = 'Minecraft' AND username= ? LIMIT 1);
//Change these to match your plugin. These commands are for zPermissions. There is setCommand and addCommand to support Xenforo's Primary and Secondary groups. {1}=group {0}=player
clearCommand: permissions player {0} purge //Set this command to clear any data on the player's groups.
setCommand: permissions player {0} setgroup {1} //This command should set a player to one group, and remove all others. For Xenforo's primary groups.
addCommand: permissions group {1} add {0} //This command adds a player to a group. For use with Xenforo's Secondary groups.
//Set the number to the ID of the Xenforo rank, then the name to your permission plugin's rank. The name is what is used in the commands.
groupMappings:
'3': Moderator
'2': Admin
'1': Owner
'4': Member
This plugin will check each player on join, and a Custom Field is used to determine their username. This means that a user can have different website and Minecraft username, and it will still sync up. Note that this method is 1-way, so setting ranks on the server-side will NOT change the Xenforo database.Code (Text):getGroups: SELECT user_group_id, secondary_group_ids FROM xf_user WHERE user_id = (SELECT user_id FROM xf_user_field_value WHERE field_id = 'Minecraft' AND username= ? LIMIT 1);
I hope this is useful to people.

XenPermissions 2013-09-28
Hook your permissions into Xenforo!