+ -
当前位置:首页 → 问答吧 → 求助CKFinder中CheckAuthentication的权限检测【asp版】

求助CKFinder中CheckAuthentication的权限检测【asp版】

时间:2011-07-24

来源:互联网

这是原来的代码:

function CheckAuthentication()
' WARNING : DO NOT simply return "true". By doing so, you are allowing
' "anyone" to upload and list the files in your server. You must implement
' some kind of session validation here. Even something very simple as...
'
' CheckAuthentication = ( Session( "IsAuthorized" ) )
'
' ... where Session( "IsAuthorized" ) is set to "true" as soon as the
' user logs in your system.

'CheckAuthentication = false
CheckAuthentication = true
End function
这样写的话只要输入地址正确,不论是否登录后台都能使用CKFinder上传文件。



这是添加过权限检测的,目的是如果没有通过验证则无法上传:
function CheckAuthentication()
' WARNING : DO NOT simply return "true". By doing so, you are allowing
' "anyone" to upload and list the files in your server. You must implement
' some kind of session validation here. Even something very simple as...
'
' CheckAuthentication = ( Session( "IsAuthorized" ) )
'
' ... where Session( "IsAuthorized" ) is set to "true" as soon as the
' user logs in your system.

'CheckAuthentication = false
if Session("admin") <> true then
  CheckAuthentication = false
  else
  CheckAuthentication = true
  end if
End function

问题出现了:不论是否登录都提示【因为安全原因,文件不可浏览. 请联系系统管理员并检查CKFinder配置文件。】请教高手给予思路为谢!

作者: gshynnu   发布时间: 2011-07-24

没有人指导一下么?自己顶一个

作者: gshynnu   发布时间: 2011-07-24