<!--#include file="../../inc/MainClass.asp"-->
<%
dim xmlobj,myString,appid,callback,appkey,mysign,is_success,notify_id,real_name,token,user_id,rs
SET xmlobj=mainClassObj.createObject("MainClass.Xml")
xmlobj.load "../api.config","xmlfile"
appid=xmlobj.getAttributes("rs:data/z:row","api_alipaypartner",0)
appkey=xmlobj.getAttributes("rs:data/z:row","api_alipaykey",0)
callback=xmlobj.getAttributes("rs:data/z:row","api_alipayreturnurl",0)
Set xmlobj = Nothing
is_success=conn.getForm("is_success","get")
notify_id=conn.getForm("notify_id","get")
real_name=conn.getForm("real_name","get")
token=conn.getForm("token","get")
user_id=conn.getForm("user_id","get")
myString="is_success="&is_success&"&notify_id="&notify_id&"&real_name="&real_name&"&token="&token&"&user_id="&user_id&appkey
input_charset="utf-8":mysign=md5.md5(myString,32)
If mysign=conn.getForm("sign","get") Then'验证
  session("openid")=user_id:session("api")="支付宝"
  set rs=conn.db("select top 1 * from {pre}user where alipayID='"&user_id&"'","records1")
  if rs.eof and rs.bof then
	with templateObj
	  .load"/"&sitePath&"template/"&defaultTemplate&"/"&templateFileFolder&"/登录绑定.html"
	  .content = Fun.replaceStr(.content,"{rendie:ret}","")
	  .content = Fun.replaceStr(.content,"{rendie:api}","支付宝")
	  .content = Fun.replaceStr(.content,"{rendie:nickname}",real_name)
	  .content = Fun.replaceStr(.content,"{rendie:figureurl}","/"&sitePath&"pic/nopic.png")
	  .parseTopAndFoot
	  .parseGlobal
	  .parseAreaList""
	  .parseMenuList""
	   
	   
	  .parseIf
	  echo .content
	end with
  else
    user.Login rs("u_username"),rs("u_pwd"),""
    response.Redirect("../../user/?info.html")
  end if
Else 
   echo "验证失败"
End If
%>