http://coldfusion.com logo
Join Slack
Powered by
# cfml-beginners
  • r

    Ryan Albrecht

    07/11/2022, 4:34 PM
    does anyone know how to downgrade coldfusion 2021 from enterprise to standard without reinstalling?
    m
    e
    • 3
    • 2
  • o

    Ookma-Kyi

    07/18/2022, 7:57 PM
    Hello everyone! I have a handler that handles routing to a few legal pages. Here is a snip:
    Copy code
    component extends="coldbox.system.EventHandler" {
    
    	// default Action
    	function index( event, rc, prc ){
    		event.setHTTPHeader( statusCode = 400 );
    		relocate(uri = "/");
    	}
    
    	// terms of service Action
    	function termsofservice( event, rc, prc ){
    		prc.pageTitle = "Terms of Service";
    		event.setView( "legal/termsofservice" );
    	}
    ...
    }
    I added a default action to redirect the user to the home page if they try to access the root of the uri example:
    localhost:8080/legal
    and set the status code to
    400 Bad Request
    . Is this correct or should i be using a different status code?
    r
    b
    • 3
    • 25
  • b

    Becky Hilton

    07/21/2022, 3:22 PM
    We are trying to implement a java interface in a Coldfusion component. The component is a callback from another java function and needs to be of a certain type. We tried several values in the implements but got errors for all of them.
    Copy code
    component implements = "java:com.digitalpersona.uareu.Engine.EnrollmentCallback" {
    
    component implements = "java:com.digitalpersona.uareu.Engine$EnrollmentCallback" {
    
    component implements = "java:Engine.EnrollmentCallback" {
    This is how we are calling it from our cfm like this
    Copy code
    createObject(component, "...callback_component").init(rc);
    and this is the error message we are seeing
    Copy code
    The java:com.digitalpersona.uareu.Engine.EnrollmentCallback ColdFusion component or interface name, used to extend or implement the model.UserProfile.callback_component component is invalid. Ensure that the file exists, that the name does not start or end with a period (.), and the name is not an empty string.
    
    Invalid component or interface name.
    We have the jar file for digitalpersona in our lib directory and are using the other classes & interfaces already. But I'm not sure we have the right value in for implements or maybe we are missing something somewhere else.
    a
    b
    • 3
    • 71
  • g

    gsr

    07/23/2022, 1:38 PM
    i ended up in a situation where i had to use QoQ but my pagination is not working because i used limit and offset in mysql anyone can guide what could be the best approach i can use to fix it
    a
    • 2
    • 2
  • g

    gsr

    07/23/2022, 1:38 PM
    LIMIT #form.length# offset #form.start#
  • a

    aliaspooryorik

    07/23/2022, 3:31 PM
    If you want pagination, then I would avoid QofQ - in fact I'd recommend never using QofQ there are likely better options. Databases are designed for things like pagination so seems appropriate to use the database to do the work. As a second point, but a very important one is to never trust user input. This:
    LIMIT #form.length# offset #form.start#
    is wide open to SQL injection attacks. You must defend against hackers. A simple
    cfqueryparam
    (if your db supports bindings in the LIMIT clause) or even a
    val(form.length)
    would be a good start.
    ✅ 2
    g
    d
    • 3
    • 2
  • o

    Ookma-Kyi

    08/02/2022, 6:17 PM
    What is the default signature of setters and getters if
    accessors="true"
    ? Example:
    Copy code
    property name="id";
    property name="username";
    property name="email";
    property name="password";
    r
    s
    • 3
    • 4
  • g

    gsr

    08/05/2022, 2:59 PM
    i was setting up Coldfusion2021 on IIS and found one directory which is also there and that was an asp.net code, now when i configured IIS using web configration tool, it included all the sites in IIS even the .net one now all my CF sites working but when i browse my asp.net i get 404 not found even on html file, i tried looking on google for this issue but every link is specifying something else, i tried most of them, none worked, is that IIS is too picky, i see the sc_scriop[ts and jakarta folders mapped there in the asp.net folder but as far as i know that should not make any difference, any clues
    e
    • 2
    • 14
  • a

    Animesh Dutta

    08/09/2022, 5:14 AM
    Hi
  • o

    Ookma-Kyi

    08/11/2022, 2:52 PM
    What is the naming convention in regards to casing for multi-word variables? For example:
    Copy code
    property name="passwordresettoken";
    	property name="passwordresettokenexpiration";
    m
    d
    +3
    • 6
    • 17
  • o

    Ookma-Kyi

    08/11/2022, 6:43 PM
    How do I make a function available to just a single handler? I searched and all I could find was shared functions and putting it inside the Application.cfc file. The problem with the first one is I couldn't find any exampels. The second one has the issue of being available to the application globally.
    d
    • 2
    • 3
  • m

    mburt

    08/11/2022, 7:30 PM
    I’m looking for a way to loop over a give time range. lets say 9:00 AM to 5:00 PM, increments of 5 minutes. I’ve found the Adobe docs on how to do this using tag syntax but I was hoping someone would know how to translate into in script syntax. Adobe Docs: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-j-l/cfloop-looping-over-a-date-or-time-range.html
    r
    p
    • 3
    • 5
  • p

    Paul Costello

    08/11/2022, 8:04 PM
    I'm trying to determine how to cfreturn an 'output inserted' value within a function, so I can display it on screen. Thanks.
    d
    r
    +2
    • 5
    • 22
  • e

    epipko

    08/18/2022, 8:46 PM
    I was asked to write a log searching app that will search a directory (or many directories) of log files and output a list of logs with word "error" in it. Anyone tried it before. I found <cfsearch> on Adobe site. Does it work well? Any other ideas?
    d
    a
    p
    • 4
    • 7
  • f

    Formiko

    08/19/2022, 2:09 AM
    I'm working on code that has <cfset request.authorized_people = '50649211,5076246,5060552'> then it has <cfif NOT listFindNoCase(request.authorized_people,GetAuthUser())> <cfabort> </cfif> how can I allow everybody? I have to see who these accounts belong to
    b
    s
    • 3
    • 13
  • f

    Formiko

    08/19/2022, 2:16 AM
    I may ask again tomorrow. listFindNoCase is confusing
  • f

    Formiko

    08/19/2022, 9:49 AM
    So the error I go was The webpage at https://www.wcl.american.edu/admiss/da/xls.cfm might be temporarily down or it may have moved permanently to a new web address.ERR_INVALID_RESPONSE when I commented out the <cfabort>
  • f

    Formiko

    08/19/2022, 10:47 AM
    I'm working on code that has <cfset request.authorized_people = '50649211,5076246,5060552'> then it has <cfif NOT listFindNoCase(request.authorized_people,GetAuthUser())> <cfabort> </cfif> how can I allow everybody? I have to see who these accounts belong to The error I got when I commented out the <cfabort>: The webpage at https://www.wcl.american.edu/admiss/da/xls.cfm might be temporarily down or it may have moved permanently to a new web address.ERR_INVALID_RESPONSE
  • f

    Formiko

    08/19/2022, 10:49 AM
    try the website yourself
  • f

    Formiko

    08/19/2022, 10:58 AM
    you can't..you need a password
    a
    • 2
    • 2
  • c

    Cody Kaczynski

    08/24/2022, 4:12 PM
    👋
  • c

    Cody Kaczynski

    08/24/2022, 4:12 PM
    can
    FileWrite
    overwrite contents of an existing file, or will i need to
    FileDelete if FileExists
    and then
    FileWrite
    ?
    a
    r
    • 3
    • 14
  • f

    Formiko

    08/26/2022, 6:24 PM
    I hawe a question about request variables I took over code, and it has this line <cfset request.authorized_people = '99991aaaa,999zzzz,99991xx,9918zzz'> which is a list of user ID's that are allowed to access the website. request authorized people is not a function, is it? It just seems arbitrary
    d
    j
    • 3
    • 21
  • f

    Formiko

    08/26/2022, 6:47 PM
    Is <cfset request.auid = GetAuthUser()> a function?
    d
    • 2
    • 16
  • f

    Formiko

    08/26/2022, 6:50 PM
    i must have skipped over that lesson
  • f

    Formiko

    08/26/2022, 6:50 PM
    I've never had to use it
  • o

    Ookma-Kyi

    08/28/2022, 1:08 AM
    Is there a channel for code reviews or do I just post it here? I am trying to figure out if there is a better way to do this then a bunch of if statements inside other if statements followed by the same thing for the else statements doing the same. Here is a
    snipplet
    of the code https://bitbucket.org/ookma-kyi/workspace/snippets/rE7agp .
    d
    a
    +4
    • 7
    • 11
  • o

    Ookma-Kyi

    08/29/2022, 5:02 PM
    Hello, I am having a weird issue where even though I routed my form to a different action it still defaults to the default action
    index
    . I have no idea why as I am new to ColdFusion. Here is a code snippet https://gist.github.com/ookma-kyi/2cc0ae7f8d7920d6c3d5b66bcbdca355.
    a
    r
    • 3
    • 9
  • s

    Slackbot

    08/30/2022, 6:12 PM
    This message was deleted.
    b
    d
    +3
    • 6
    • 46
  • g

    gsr

    09/03/2022, 12:57 PM
    buying a vps on centos7+pleasek, can i install lucee server?, asking because never tried yet
    g
    p
    • 3
    • 8
12345...8Latest