KesionCMS V8.0x默认只允许会员用会员名登录,我们可以通过小修改,允许使用会员名,会员ID及email进行登录。
具体修改方法如下:
打开user/checkuserlogin.asp,并找到如下代码
PassWord=MD5(PassWord,16)
Dim UserRS:Set UserRS=Server.CreateObject("Adodb.RecordSet")
UserRS.Open "Select top 1 * From KS_User Where UserName='" &UserName & "' And PassWord='" & PassWord & "'",Conn,1,3
修改替换为以下代码即可:
UserName=lcase(UserName)
PassWord=MD5(PassWord,16)
Dim Param:Param=" Where PassWord='" & PassWord & "'"
If InStr(UserName,"@")<>0 Then
Param=Param & " and Email='"& UserName & "'"
ElseIf Len(UserName)<10 and IsNumerIc(UserName) Then
Param=Param & " and (UserId=" & KS.ChkClng(UserName) & " or username='" & UserName &"')"
Else
Param=Param & " and UserName='" &UserName & "'"
End If
Dim UserRS:Set UserRS=Server.CreateObject("Adodb.RecordSet")
UserRS.Open "Select top 1 * From KS_User" & Param,Conn,1,3
www.866msc.com