2 Replies Latest reply on Mar 15, 2007 4:37 PM by WestSide

    Custom Messages?

    WestSide Level 1

      I would like to build some custom message handler to handle various custom messages throughout the app. I am not interested in the CF errors and/or messages, but more of things like "Account Updated" "Account Locked due to multiple attempts". I am looking to have a storage mechanishm to hold these error messages either in the DB which may be easiest for me or I have heard of some using an XML File and reading from that. I want to use UUID's for each error message so in the url you might see errorId=4854-48484-24121-545464 or some long UUID. I think this will prevent or deter url tampering, having simple values like errorCode=3 or errorCode=4 seems to easy for users to swap values. At least it seems that way to me.

      As of now, I do this on the display page

      <cfparam name="variables.errorMsg" default="" />
      <cfparam name="attributes.ec" default="0" />

      <cfswitch expression="#attributes.ec#">
      <cfcase value="1">
      <cfset variables.errorMsg = "Account not found. Please try again. " />
      <cfcase value="2">
      <cfset variables.errorMsg = "Account Locked. "/>

      This does work, but Id like to find a more elegant solution.

      Any thoughts?

        • 1. Re: Custom Messages?
          insuractive Level 3
          You could use toBase64() to encode the strings in a URL-safe format that is hard to tamper with (at least for the general population). Is there a particular reason you are worried about the users playing around with what error messages they see?
          • 2. Re: Custom Messages?
            WestSide Level 1

            Well, I was planning to use some of a UUID or use sql server's newId() function in other areas of the system, so certain parts of the app would pass these uuid's in the url and I wanted to be consistent all the way around. That is part of it. Small part of it is me just not wanting the user to do it also. But it was more for consistency.