Posted on 2008-04-27 19:25
lxasp 阅读(1382)
评论(0) 编辑 收藏 引用 所属分类:
ASP
<!--#include file="acp/acp.asp"-->
<!--#include file="config.asp"-->
<!--#include file="app/Nome_MD5.asp"-->
<%
NoCache
If Request.QueryString("go")="check" Then
Call CheckLogin()
Else
If tp.Open("admin\Login.htm") Then
tp("FORM_ACT")="?go=check"
tp.Pump
Else
zerr "打开模板失败"
End If
End If
Sub CheckLogin()
Dim a,b
With db
.TypeStr
Dim VF_ua_name : VF_ua_name=.VF("ua_name")
Dim VF_ua_pwd : VF_ua_pwd=.VF("ua_pwd")
Dim VF_vpwd : VF_vpwd=.VF("vpwd")
Dim VF_vcode : VF_vcode=.VF("vcode")
End With
If db.HasErr Then
zerr db.GetErr
End If
If Session("GetCode")<>VF_vcode Then zerr "验证码不正确"
If VF_vpwd<>"123" Then zerr "内部密码不正确"
a=db.Read("SELECT ua_id, ua_name, ua_pwd, ua_ugid, ug_name FROM LX_UA LEFT JOIN LX_UG ON LX_UA.ua_ugid = LX_UG.ug_id WHERE " & db.ES("ua_name","=",VF_ua_name) )
If Not IsArray(a) Then zerr "用户名不正确"
If a(2,0)<>md5(VF_ua_pwd) Then zerr "密码不正确"
b=db.Read("SELECT lf_id FROM LX_MGF WHERE flag=-1 AND " & db.EN("ug_id","=",a(3,0) ) & " ORDER BY lf_id " )
Session("ua_id")=a(0,0)
Session("ua_name")=a(1,0)
Session("ua_ugid")=a(3,0)
Session("ua_ugname")=a(4,0)
Session("ua_rgt")=XRgt(b)
Pause("<script>window.top.location.replace('Admin.asp')</script>")
End Sub
Function XRgt(rgts)
Dim i,a,u
If IsArray(rgts) Then
u=UBound(rgts,2)
ReDim a(u)
For i=0 To u
a(i)=","&rgts(0,i)
Next
XRgt=Join(a,"")
End If
End Function
%>