I have been working on a nice solid SMF bridge with WoW Roster. I need some feedback from those of you actually running SMF. I need to know, what you are all looking for.
To me, a bridge should not modify the original code, or atleast use as few modifications as possible. There are a few problems with "bridging" with WoW Roster that I can see. As of version 1.7.1 I don't see much of a "user" system other than the simple admin login password. In order to implement, it requires modifications to several of the original scripts. When new versions of WoW Roster are released, it all starts over with a new coding up a new "bridge."
Most of the bridging can be handled by modifying the Login.php script. Basically load up the SMF environment to find out what user is logged into SMF and access the SMF permissions for that user. From there there are several WoW Roster scripts that need to be modified to actually make use of the SMF permissions.
Login.php: Load up the SMF environment and gather permission information about the currently logged in user.
Update.php: Replace the "password" login with an SMF permissins check.
Admin.php: Replace the "password" login with SMF permissions check.
Menu.php: Show/Hide relevant menu options based on SMF permissions.
Some of the inital problems. SMF and WoW Roster share some of the same global variables for the Database connection. Not really an issue if they they both share the same Database, but if they are on seperate databses, it is an issue.
Basically, what I came up with was 3 new SMF permissions:
- View Roster (so you can deny specific member groups permission to view your guilds roster.)
- Admin Roster (give permission to member groups to be able to change the settings on the roster)
- Update Guild (gives permission to your guilds officers to be able to update the guilds roster.)
Added an SMF Bridge file that does nothing more than figure out which user is currently viewing the WoW Roster and retrieves the permissions for that user.
Had to make a few changes to the following files:
roster/update.php (removed the password box for users with update permission.)
roster/index.php (passwords are not needed since were using a bridge)
roster/lib/menu.php (hides the Roster Config button for non admins)
roster/lib/login.php (modifies the RosterLogin class to use the new SMF permissions)
Added new files to SMF:
sources/Roster.php (WoW Roster is called with ?action=roster from SMF)
Themes/default/Roster.template.php (sets up a dynamic iframe to view WoW roster within your SMF theme)
Modified Files in SMF:
index.php (added the ?action=roster subcommand)
Themes/default/index.template.php (added a new navigation link to "Roster")
sources/ManagePermissions.php (added new permissions)
Themes/default/languages/Modifications.english.php (describes the new permissions and shows others "<user> is viewing the guild roster.")
The bridge reads cookies from the users browser (like smf does) to see if the current user is actually logged in. If those cookies are not found the bridge defaults WoW Roster back to normal operation (with the password boxes, etc.)
This "Bridge" is for a fresh installation ONLY. It modifies some of the install files. It does eliminate the "password login" from most of the pages and uses SMF permissions in its place, BUT it still allows you to set an admin password in those cases where it cannot find a logged in user or cannot for whatever reason load the SMF environment. You should still set a password just in case.
Install Steps:
1) Extract the wow roster package to a folder on your local harddrive.
2) IMPORTANT!!!: FTP the wow roster contents to a folder named 'roster" to a folder WITHIN your SMF folder. (must be all lower case for the package installer to find the wow roster folder)
<root>/<forum>/roster
3) upload the SMF_Bridge.zip through the SMF package manager. This should set up a "Guild Roster" tab on the default theme and it also addds the new SMF permissions for WoW Roster.
4) The package manager makes the changes to the WoW Roster files to incorporate the bridge and starts the (modified) install.php from the WoW Roster package.
5) Once you get to the "you need to delete the install folder, install.php, and update.php" you can simply click the new "Guild Roster" tab in the default theme and the bridge will delete those for you. (or you can delete them manually).
6) Set up your guild settings and upload your inital guild roster.
7) Check the "Can View Guild Roster" permission for all member groups you want to be able to view the roster page.
It is always a good idea to test out new mods and new software on a local test site, never on a live board. Always back everything up before installing anything new.