Coldfusion:检测是否由调度程序运行 [英] Coldfusion: Detecting if being run by the scheduler

查看:174
本文介绍了Coldfusion:检测是否由调度程序运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让ColdFusion应用程序知道它是从调度程序还是从浏览器运行?理想情况下,我想在Application.cfm中设置一个会话标志,例如isScheduled,以便在整个应用程序中使用。

Is there a way for a ColdFusion app to know whether it is being run from the scheduler vs. from a browser? Ideally, I'd like to set a Session flag, for instance "isScheduled" in Application.cfm to be used throughout the app.

EDIT
我最后检查用户代理,以提高安全性),以及(因为它在Application.cfm中运行)页面位于允许调度的文件夹中:

EDIT I ended up checking the user agent, and that it is being run locally (to improve security), and (since it is running in Application.cfm) that the page is in the folder which allows scheduling:

请求。 isScheduled = FindNoCase(CFSCHEDULE,CGI.HTTP_USER_AGENT)
和(Find(10。,CGI.REMOTE_ADDR)== 1
或Find(198.162。,CGI.REMOTE_ADDR)== 1)
和FindNoCase(scheduled,CGI.CF_TEMPLATE_PATH);

推荐答案

检查用户代理。用户代理是CFSCHEDULE,但请先确认。

Check for the user agent. The user agent is "CFSCHEDULE" but please confirm this first.

这篇关于Coldfusion:检测是否由调度程序运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆