I have a bad habit of sending posts before they are ready...
I wanted to mention that if you add a sesssion structure to track addtional user info, you will need to modify the
SELECT query in the GetUser function in the security.cfc component, to include the additional fields in the PlumUser table.
Jeff
Jeff Fleitz wrote:
Hi Mark,
Are you using sessions? If you are, this is pretty easy to do, if you
are willing to modify the security.cfc component. If you decide to do
this, please make sure to make a backup copy. Once you make the mods you
will have to re-run setup.
Inside the AuthenticateAndAuthorizeViaDatabase function in the
security.cfc you can add code to the following block:
<cfif userQuery.RecordCount NEQ 1>
default code here...
</cfif>
By changing to:
<cfif userQuery.RecordCount NEQ 1>
default code here...
<cfelse>
<!--- new code here --->
<cfset Session.userID = userQuery.UserID>
</cfif>
Now the userID is available throughout the session and you can use it as
you need to.
Just place a PassColumnToAction tag inside of the InsertRecord:
<cf_PassColumnToAction column="userID" type="integer"
value="#Session.UserID#" valueIfEmpty="NULL">
What I have done, in my own apps is to modify the PlumUser table to
include other fields which track useful user info, like last login
datetime, number of times logged in. Then you can create a structure to
keep track of these session settings.
<cfif userQuery.RecordCount NEQ 1>
default code here...
<cfelse>
<cfset Session.User = StructNew()>
<cfscript>
Session.User.userID = userQuery.UserID;
Session.User.lastLogin = userQuery.LastLogin;
Session.User.timesLoggedIn = userQuery.TimesLoggedIn +1;
Session.User.rowsPerPage = userQuery.RowsPerPage;
Session.User.displayIcons = userQuery.DisplayIcons;
</cfscript>
</cfif>
Make sense?
Jeff
Mark Fuqua wrote:
Hey there,
I can see from the docs how to get a cookie and set a variable to be = to
that cookies value [<cfset userID =
Application.CookieAPI.GetCookie("userID")>].
How can I then use this in an insert?
Is there a way to pass this value to PLUM's <cf_InsertRecord> custom tag?
Or perhaps insert this value as the default value in a text field in
<cf_displayAddForm>?
Additionally, is there a way to set a session variable and then use it
the
same ways?
Thanks for your help.
Mark Fuqua
**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:
http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************
**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:
http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************
**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:
http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************