Alright here is the situation.
I have been tasked at my work to integrate a coldfusion forum (Galleon) into the existing CRM that are using for the merchants.
The issue is, the original CRM itself has its own login and a 'user' table in the database. Galleon uses its own login page and 'user' file..
My partner and I on this are racking our brains trying to figure out this (admittedly simple) problem. We thought about the possibility of defining a global variable, like a session, and once triggered by the primary login for the CRM it would bypass the Galleon login.
But this doesn't solve the problem of telling Galleon who the user is so he can post..
I'm thinking one of the ways to solve this issue is to insert the entirety of the original CRM user file into the Galleon user file. That way it has a list of identical user\passes.
Any ideas guys?
Breakdown:
User logins in at CRM splash page----->Brought to CRM index.cfm\main panel. User can then click on "CRM FORUM!" and instead of being re prompted for a user\pass Galleon knows who he is and allows him to make threads and post.
There are definitely a number of ways to skin the cat on this. I downloaded the Galleon 2 forum code to take a peek at the user.cfc
You could modify the query in this function to pull the fields it requires from your CMS:
<cffunction name="getUser" access="public" returnType="struct" output="false" hint="Returns a user.">
<cfquery name="qGetUser" datasource="#variables.dsn#">
SELECT
[cmsusertable].cmsid as ID,
[cmsusertable].cmsuser as username,
[cmsusertable].cmspassword as password,
[cmsusertable].cmsemail as emailaddress,
[cmsusertable].createDate as datecreated,
[cmsusertable].cmsactive as confirmed,
[cmsusertable].cmssignature as signature,
[cmsusertable].cmsavatar as avatar
FROM
[cmsusertable]users
WHERE
[cmsusertable].username = <cfqueryparam value="#arguments.username#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
</cfquery>
Remember that you must return the fields from the query as Galleon expects them, so use the 'as' statement to rename your CMS database fields to what Galleon expects. Now some of these extraneous fields you might not have in your CMS table such as Signature / Avatar. If you can extend your CMS table and user routines to accommodate these fields, that might be good. Or you could modify the profile routines in Galleon to only update the Signature/Avatar instead of the whole profile. If you do use the Galleon tables to store this information, remember to add a join to include these fields where requested to reunify the user data.
You'll also have to modify the joins in about 4 files (user.cfc, conference.cfc, message.cfc, thread.cfc) in the project to join with your CMS user table instead.
Lastly, you'll have to modify the the login.cfm to simply attempt to set the session.user struct using the information in the CMS user session and failing that, redirect the user back to the CMS login page.
Overall I don't think it would be too difficult. I'm sure there's stuff I missed but perhaps that would get you going.