<% dim action : action=getForm("action","get") if action = "login" then dim UserName,Password,sql,code,Rs,atype UserName = filterPara(getForm("username","post")) atype = getForm("atype","post") Password = md5(getForm("Password","post"),16) code = getForm("code","post") if code <> Session("Code") then alertMsgAndGo "您填写的验证码错误!","-1" if isOutSubmit then alertMsgAndGo"非法外部提交被禁止","-1" ' User UserGroup ' LoginName 'Password 'GroupID 'IsAdmin sql = "select count(*) from {prefix}User where LoginName = '"& UserName &"' and Password='"&Password&"'" Dim rsObj : Set rsObj=Conn.Exec(sql,"r1") if rsObj(0)=1 then Set rsObj=Conn.Exec("select IsAdmin, GroupStatus,GroupName, UserStatus, UserID, GroupMenu, LanguageID from {prefix}User as a, {prefix}UserGroup as b where LoginName='"&UserName&"' and a.GroupID=b.GroupID","r1") if not rsObj.Eof Then if rsObj("IsAdmin")<>1 then alertMsgAndGo"对不起,你不是管理员!","-1" if rsObj("GroupStatus")<>1 then alertMsgAndGo"对不起,您所在用户组已被禁用!","-1" if rsObj("UserStatus")<>1 then alertMsgAndGo"对不起,您的账号已被禁用!","-1" wCookie"adminName",UserName wCookie"GroupName",rsObj("GroupName") 'wCookie"adminpwd",getForm("Password","post") Session("adminpwd") = getForm("Password","post") wCookie"adminId",rsObj("UserID") wCookie"groupMenu",repnull(rsObj("GroupMenu")) '查找 dim LanguageID LanguageID=rsObj("LanguageID") if isnul(LanguageID) then set rs=conn.exec("select LanguageID,LanguagePath,Alias from {prefix}Language where IsDefault=1","exe") if rs.eof then echoErr err_15,15,"没有设置默认语言" else LanguageID=rs(0) end if else set rs=conn.exec("select LanguageID,LanguagePath,Alias from {prefix}Language where LanguageID="&LanguageID,"exe") LanguageID=rs(0) end if wCookie"languageID",LanguageID wCookie"LanguagePath",rs("LanguagePath") wCookie"LanguageAlias",rs("Alias") rs.close : set rs=nothing Conn.Exec"update {prefix}User set LastLoginTime='"&now()&"',LastLoginIP='"&getIp()&"',LoginCount=LoginCount+1 where UserID="&rsObj("UserID"),"exe" if atype=0 then response.Redirect("index.asp") else response.Redirect("index_user.asp") end if end if else alertMsgAndGo "用户名或密码错误!","-1" end if rsObj.Close() : set rsObj=Nothing elseif action = "logout" then wCookie"adminName","" wCookie"adminId","" wCookie"groupMenu","" wCookie"SceneMenu","" response.Redirect("login.asp"):response.End() elseif action = "relog" then alertMsgAndGo "对不起,您的登录状态已经失效,请重新登录!","login.asp" end if %> <%=setting.siteTitle%>-开源企业网站管理系统- Powered by AspCms2.0
用户名:
密码:
验证码:
点我刷新
类型:
简单版 全功能版
 
ASPCMS!是 大招牌网 旗下 五八传媒创新实验室 推出的以企业建站系统,帮助其实现一站式服务。 返回首页