Skip to main content
WolfShade
Legend
January 30, 2015
Question

Add a script to CFIDE/Administrator and run it?

  • January 30, 2015
  • 1 reply
  • 389 views

Hello, everyone,

Is it possible to add a script (.cfm file) to /CFIDE/Administrator and run it?

I've got a script that is used for reindexing and optimizing a small set of Solr collections, and the PTB do not want it publicly accessible (even though it will never touch a database, and I have conditions set so that only one of us can run it), so they are asking if it can be run from within the protected /CFIDE/Administrator folder.

I copied my script (and an associated .gif image) to my local CF server /CFIDE/Administrator folder, but I can't run it.  Every time I browse to it, I get redirected to the login page.

V/r,

^_^

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    February 1, 2015

    Yes, you may add an arbitrary CFM page to /CFIDE/Administrator and run it. But you first have to log in to the Administrator. That is why ColdFusion redirects you to the login page. As you yourself say, the /CFIDE/Administrator folder is protected.

    WolfShade
    WolfShadeAuthor
    Legend
    February 2, 2015

    Thanks, BKBK!  It didn't even occur to me to log on, first.

    But that could present a problem, if I wanted to add a script and then set it up in Scheduled Tasks, wouldn't it?  Requiring a logon, first?  Or would Scheduled Task run it with Admin privileges?

    V/r,

    ^_^

    BKBK
    Community Expert
    Community Expert
    February 3, 2015

    To be quite honest, WolfShade, even if it should work, I would strongly advise against it. /CFIDE/Administrator/ is a system directory. As such, it should contain no custom user scripts.

    A solution is possible that involves putting the script and GIF in a directory elsewhere in the web root. You could, for example, implement authentication in the directory or exclude its path in the web server settings. You should revisit the subject with your PTB and discuss these possibilities with them.