Pre CFMX days, I wrote a CFX tag for adding and deleting debugging IP addresses without needing ColdFusion Administrator access. That tag simply manipulated the registry, and obviously it will not work with CFMX (which thankfully no longer uses the registry to store those settings). So, after some frustration yesterday and not being able to get to a ColdFusion Administrator when I needed to, I wrote a ColdFusion Component that allows you to list, add, and delete IP addresses from the debugging IP address list, without needing any access to the ColdFusion Administrator. Here is the code for debugip.cfc:

Usage is simple, to add your current IP address you could do the following:

Or use the CFC as an object:


10 thoughts

  1. You could replace your listGetAt chunk of IP validation code with the following RegEx to clean it up a bit:
    Validate against the above pattern and you should be good to go.

  2. Dave, not so simple. CF has no REMatch() function, REFind() will return a match if the IP address is in the middle of the string, and so even using that RE you’d need to do additional processing. And so, in the interest of not having to explain what the funky processing is and why, I did it this way.

  3. Why not anchor the RE with ^ at the beginning and $ at the end so it matches the entire string? Or am I missing something?

  4. Paul, I’ve already sent it to Rob to include on CFCZone.
    Sean, yep, that’s a duh! one, changed it. Honestly, I was not paying much attention that part of the code, that validation was an afterthought and just thrown in, the key was the core functionality. And I am working on another one, this time working with datasources.

  5. Could this be expanded to manage the list on a multipule instance CFMX setup? So that it would update/change/modify all instances at the same time?

Leave a Reply