我正在尝试使用以下内容为我网站的管理文件夹启用页面安全性
我的应用程序的结构就像 switch case 语句
index.cfm
页面有switch.cfm
进一步将代码定义为:
<cfswitch expression="#mode#">
<cfcase value="admin.1"><cfinclude template="1.cfm"></cfcase>
<cfdefaultcase><cfinclude template="login.cfm"></cfcase>
</cfswitch>
现在我application.cfc
的定义是这样的
<cfif (NOT structKeyExists( session, "isLoggedIn" )) OR (session.isLoggedIn eq false) AND CGI.query_string contains 'admin'>
<cfinclude template="index.cfm"> - why `index`, it will include the `switch.cfm` and `switch.cfm` has the `defaultcase` of `login.cfm`, so apparently it will include `login.cfm` - **This is why i think it should do**.
现在,当我将我的页面称为:
http://localhost/?mode=admin.1
- 它进入它,而不是将用户发送到login.cfm
,我错过了什么