<!-- #include file="config.asp" -->
<!-- #include file="jk_md5.asp" -->
<!-- #include file="send_mail.asp" -->
<!-- #include file="val_code.asp" -->
<!-- #include file="skin.asp" -->
<!-- #include file="mail.asp" -->

<%
dim err_head,power,rndnum,num1,dler,lasttime,username,password,passwd
err_head=img_small("jt0")
index_url="user_main"
tit_fir=objv7.format_menu(web_menu,index_url)

sub nopass()
  dim pass_action
  pass_action=trim(request.form("pass_action"))
  response.write admin_bar("密码问题",1,"280")
  select case pass_action
  case "question"
    if objv7.post_chk()<>"yes" then
      call close_conn()
      call cookies_type("post")
    end if
    response.write pass_question()
  case "chk"
    if objv7.post_chk()<>"yes" then
      call close_conn()
      call cookies_type("post")
    end if
    response.write pass_chk()
  case else
    response.write pass_type()
  end select
  response.write admin_bar("",2,"280")
end sub

function pass_question()
  dim username
  username=trim(request.form("username"))
  if symbol_name(username)<>"yes" then
    pass_question="您输入的 <font class=time>登陆名称</font> 为空或不符合相关规则！<br><br>"&go_back
    exit function
  end if
  pass_question="<table border=0 align=center><form action='login.asp?action=nopass' method=post>" & _
		"<input type=hidden name=pass_action value='chk'>" & _
		"<tr height=40><td>登陆名称：</td><td><input type=text name=uname size=20 value='"&username&"' readonly class=inputbg></td></tr>" & _
		"<tr height=25><td>密码钥匙：</td><td><input type=password name=passwd size=20 maxlength=20 class=inputbg></td></tr>" & _
		"<tr height=25><td>电子邮件：</td><td><input type=text name=email size=20 maxlength=50 class=inputbg></td></tr>" & _
		"<tr height=40><td colspan=2 align=center><input type=submit value='取 得 密 码' class=inputbg></td></tr>" & _
		"<tr><td colspan=2 align=center><font class=gray>数据验证无误后将随机生成密码；<br>并发送到您的电子邮箱里。</font></td></tr>" & _
		"<input type=hidden name=username value='"&username&"' class=inputbg></form></table>"
end function

function pass_chk()
  dim username,uname,email,newpass,uid,sbody,weburl,webname,sendmail
  username=trim(request.form("username"))
  uname=trim(request.form("uname"))
  passwd=trim(request.form("passwd"))
  email=trim(request.form("email"))
  if symbol_name(username)<>"yes" or username<>uname then
    pass_chk="您输入的 <font class=time>登陆名称</font> 为空或不符合相关规则！<br><br>"&go_back
    exit function
  end if
  if symbol_name(passwd)<>"yes" then
    pass_chk="您输入的 <font class=time>密码钥匙</font> 为空或不符合相关规则！<br><br>"&go_back
    exit function
  end if
  if objv7.email_ok(email)<>"yes" or len(email)>50 then
    pass_chk="您输入的 <font class=time>E-mail</font> 为空或不符合邮件规则！<br><br>"&go_back
    exit function
  end if
  sql="select top 1 id from user_data where username='"&username&"' and passwd='"&jk_md5(passwd,"short")&"' and email='"&email&"' and hidden=1"
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    rs.close:set rs=nothing
    pass_chk="<font class=time>登陆名称</font> 和 <font class=time>密码钥匙</font> 有错或您已被锁定！<br><br>"&go_back
    exit function
  end if
  uid=rs("id")
  rs.close:set rs=nothing
  newpass=objv7.rand_num(6)
  sql="update user_data set password='"&jk_md5(newpass,"short")&"' where id="&uid
  conn.execute(sql)
  webname=objv7.web_var(web_config,1)
  weburl=objv7.web_var(web_config,2)
  sbody="注：本邮件为系统在用户取回密码时所发送的邮件！" & _
	vbcrlf&"--------------------------------------------------------" & _
	vbcrlf& webname & _
	vbcrlf& weburl & _
	vbcrlf&"--------------------------------------------------------" & _
	vbcrlf& _
	vbcrlf&"亲爱的"&username&"，你好！" & _
	vbcrlf& _
	vbcrlf&"您于 "&objv7.time_type(now_time,33)&" 使用了系统的密码取回功能！" & _
	vbcrlf& _
	vbcrlf&"系统生成的随机密码为："&newpass& _
	vbcrlf& _
	vbcrlf&"请尽快登陆本站并将您的修改一个复杂的密码！" & _
	vbcrlf& _
	vbcrlf& weburl &"login.asp"& _
	vbcrlf& _
	vbcrlf&"--------------------------------------------------------" & _
	vbcrlf&"更多精彩信息请访问：" & _
	vbcrlf& _
	vbcrlf& webname & _
	vbcrlf& weburl & _
	vbcrlf& _
	vbcrlf&"欢迎您的光临！"
  sendmail=sendmail=send_jmail(email,"系统邮件：取回密码",sbody,"（系统管理员）","system@mail")
  pass_chk="<font class=hit><b>"&username&"</b></font>，<font class=time>您已成功取回了密码（系统随机生成）！</font><br><br>" & _
	   "随机密码已发送到您的电子邮箱：<font class=time>"&email&"</font><br><br>" & _
	   "请及时取回密码并登陆本站重新修改。<br><br><a href='login.asp'>点击进入登陆页面</a>"
end function

function pass_type()
  pass_type="<table border=0 align=center><form action='login.asp?action=nopass' method=post><input type=hidden name=pass_action value='question'><tr height=40><td>您的登陆名称：</td><td><input type=text name=username size=20 maxlength=20 class=inputbg></td></tr><tr height=40><td></td><td><input type=submit value='下 一 步' class=inputbg></td></tr></form></table>"
end function

sub register_main()
response.write admin_bar("注册向导",1,"70%")
  if int(objv7.web_var_num(web_setup,8,1))=1 then
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr align=center><td height=100>
<font class=time>对不起！</font>本站暂停注册新的用户！<br><br>如有需要，请与管理员联系。
</td></tr></table>
<%
    exit sub
  end if
  
  dim reg_action,left_i
  reg_action=trim(request.form("reg_action"))
  if reg_action="reg_chk" and objv7.post_chk()<>"yes" then
    call close_conn()
    call cookies_type("post")
  end if
  select case reg_action
  case "reg_main"
    left_i=2
  case "reg_chk"
    left_i=3
  case else
    left_i=1
  end select
%>
  <table border=0 width='90%' cellspacing=0 cellpadding=0 align=center>
  <tr><td align=center height=300><%
  select case reg_action
  case "reg_main"
    call reg_type()
  case "reg_chk"
    response.write reg_chk()
  case else
    call reg_policy()
  end select
%><br><br></td></tr>
  </table>
<%
response.write admin_bar("",2,"70%")&kong
end sub

sub reg_policy()
%>
<div align="center">
  <center>
<table border=0 width=500 cellspacing=0 cellpadding=0 style="border-collapse: collapse" bordercolor="#111111" height="250">
<tr><td rowspan="2" width="40%"><FONT color=#ff0000>
  <img border="0" src="images/video/youhui.gif" width="235" height="251"></FONT></td>
  <td width="30%" height="50%" bgcolor="#FFFF00" valign="top">
<form name=form_reg action='login.asp?action=register&power=user' method=post>
<input type=hidden name=reg_action value='reg_main'>
<input type=hidden name=power value='user'>免费用户
<input type=submit value="立即注册" class=inputbg></form>可以免费使用<%response.write objv7.web_var(web_reg,8)%>天,通过你的邮箱发送密码，注册后请登录你的邮箱查收密码</td>
  <td width="30%" height="50%" bgcolor="#00FF00" valign="top">
<form name=form_reg action='login.asp?action=register&power=VIP' method=post>
<input type=hidden name=reg_action value='reg_main'>
<input type=hidden name=power value='vip'>包点会员 
<input type=submit value="立即注册" class=inputbg></form>
<p align="center">VIP会员：<%response.write objv7.web_var(web_lst,2)%>元/月，<%response.write objv7.web_var(web_lst,3)%>元/3个月 <%response.write objv7.web_var(web_lst,4)%>元/6个月&nbsp; <%response.write objv7.web_var(web_lst,6)%>元/12个月</p>
  </td></tr><tr><td width="30%" height="50%" bgcolor="#00FFFF" valign="top">
<form name=form_reg action='login.asp?action=register&power=gold' method=post>
<input type=hidden name=reg_action value='reg_main'>
<input type=hidden name=power value='gold'>包月会员 
<input type=submit value="立即注册" class=inputbg></form>正式会员：没有浏览次数的限制,提供下载服务。分为<%response.write objv7.web_var(web_lst,5)%>元/月 <%response.write objv7.web_var(web_lst,12)%>元/3个月 <%response.write objv7.web_var(web_lst,13)%>元/6个月 <%response.write objv7.web_var(web_lst,14)%>元/12个月</p>
  </td><td width="30%" height="50%" bgcolor="#FF00FF" valign="top">
<form name=form_reg action='login.asp?action=register&power=carer' method=post>
<input type=hidden name=reg_action value='reg_main'>
<input type=hidden name=power value='carer'>代理会员 
<input type=submit value="立即注册" class=inputbg></form>代理本站的会员卡销售业务,期待你加入本站的代理</td></tr>

</table>
  </center>
</div>
<%
end sub

sub reg_type()
  response.write val_code(1)
%><br>
<form name=val_name_frm action='val_username.asp' method=post target=hiddenframe>
<input type=hidden name=username value=''>
</form>
<iframe width=0 height=0 src='about:blank' name=hiddenframe></iframe>
<script language=javascript>
<!--
function val_name()
{
  var username=document.reg_frm.username.value;
  if (username=="")
  { alert("请先填写您要注册的 用户名称 ！"); return false; }
  else
  { document.val_name_frm.username.value=username; document.val_name_frm.submit(); }
}


function reg_check()
{
  if (reg_frm.username.value=="")
  { alert("请填写您的 用户名称 ！"); return false; }
  if (reg_frm.password.value=="" || reg_frm.password2.value=="")
  { alert("请填写您的 登陆密码 和 确认密码 ！"); return false; }
  else
  {
    if (reg_frm.password.value != reg_frm.password2.value)
    { alert("登陆密码 和 确认密码 必须相同！"); return false; }
  }
  if (reg_frm.passwd.value=="")
  { alert("请填写您的 密码钥匙 ！"); return false; }
  if (reg_frm.email.value=="")
  { alert("请填写您的 Email ！"); return false; }
  if (reg_frm.valcode.value=="")
  { alert("请填写 验 证 码称 ！"); return false; }
}
-->
</script>
  <table border=0 width=360 cellspacing=0 cellpadding=2>
  <tr><td width='35%'></td><td width='65%'></td></tr>
  <form name=reg_frm action='login.asp?action=register' method=post onsubmit="frm_submitonce(this);">
  <input type=hidden name=reg_action value='reg_chk'>
  <tr><td align=center>用户名称：</td><td><input type=text name=username size=20 maxlength=20 class=inputbg><%=redx%><input type=button value='验证用户名' class=inputbg title='点击验证您填写的用户名是否可以注册' onclick="javascript:val_name();"></td></tr>

<%if trim(request.form("power"))<>"user" then
if objv7.web_var(web_reg,16)=0 then%>
    <tr><td align=center>登陆密码：</td><td><input type=password name=password size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
    <tr><td align=center>确认密码：</td><td><input type=password name=password2 size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
    <tr><td align=center>密码钥匙：</td><td><input type=text name=passwd size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
<%else%>
  <tr><td align=center colspan="2">系统将自动生成密码发送到你的邮箱</td></tr>
<%end if
end if%>

<%if trim(request.form("power"))="user" then
if objv7.web_var(web_reg,4)=0 then%>
    <tr><td align=center>登陆密码：</td><td><input type=password name=password size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
    <tr><td align=center>确认密码：</td><td><input type=password name=password2 size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
    <tr><td align=center>密码钥匙：</td><td><input type=text name=passwd size=20 maxlength=20 class=inputbg><%=redx%></td></tr>
<%else%>
  <tr><td align=center colspan="2">系统将自动生成密码发送到你的邮箱</td></tr>
<%end if
end if%>
<input type=hidden name=power value='<%=trim(request.form("power"))%>'>
  <tr><td align=center>E - mail：</td><td>
    <input type=text name=email size=20 maxlength=50 class=inputbg><%=redx%></td></tr>
  <tr><td align=center>您的性别：</td><td>&nbsp;<input type=radio name=sex value='boy' checked>&nbsp;男孩&nbsp;&nbsp;&nbsp;<input type=radio name=sex value='girl'>&nbsp;女孩&nbsp;<%response.write redx%></td></tr>
  <tr>
    <td align=center>推荐代理：</td><td><input type="hidden" name="DLER" value="<%=request.cookies("DLER")%>">
    <font color="#00FFFF"><%=request.cookies("DLER")%></font> 该推荐代理不影响你注册和在本站观看电影,你必需接受<%=redx%></td>
  </tr>
  <tr><td align=center>验 证 码：</td><td><%response.write val_code(2)%></td></tr>
  <tr><td></td><td height=50><input type=submit value=' 现 在 注 册 ' onclick="return reg_check()" class=inputbg></td></tr>
  </form>
  <tr><td colspan=2 height=30><hr size=1 color=#c0c0c0 width='90%'></td></tr>
  <tr><td colspan=2>
<p style='line-height: 150%'><font class=time_2>用户注册注意事项：</font><br>
&nbsp;&nbsp;&nbsp;1、用户名称注册申请成功之后将不能更改。<br>
&nbsp;&nbsp;&nbsp;2、用户名称可以是大小写英文字母（a~z、A~Z）、阿拉伯数字（0~9）、
连接字符“-”、下划线“_”和汉字组成；首字符不能为连接字符“-”或下划线“_”，长度不能超过20位。例：csk_527<br>
&nbsp;&nbsp;&nbsp;3、登陆密码只能由大小写英文字母（a~z、A~Z）、阿拉伯数字（0~9）、
连接字符“-”和下划线“_”组成。例：dw7v9j<br>
&nbsp;&nbsp;&nbsp;4、如出现“<font class=time>验证码错误</font>”的提示，请刷新后再填写注册信息。<br>
&nbsp;&nbsp;&nbsp;5、以上要填写的注册信息的内容均不区分大小写。</p>
  </td></tr>
  </table>
<%
end sub

function reg_chk()
  dim username,password,password2,passwd,email,red
  username=trim(request.form("username"))
  password=trim(request.form("password"))
  password2=trim(request.form("password2"))
  passwd=trim(request.form("passwd"))
  email=objv7.code_form(trim(request.form("email")))
  power=trim(request.form("power"))
  DLER=objv7.code_form(trim(request.form("DLER"))) 
  red=""
  if symbol_name(username)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>用户名称</font> 为空或不符合相关规则！<br>"
  else
    if health_name(username)<>"yes" then
      red=red&err_head&"您输入的 <font class=time>用户名称</font> 含有<font class=time>本系统禁用字符</font>！<br>"
    end if
  end if
  
if trim(request.form("power"))<>"user" then
    if objv7.web_var(web_reg,16)=1 then
	Randomize
	Do While Len(rndnum)<8
	num1=CStr(Chr((57-48)*rnd+48))
	rndnum=rndnum&num1
	loop
	password=jk_md5(rndnum,"short")
	passwd=jk_md5(rndnum,"short")
	else
  if symbol_ok(password)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>登陆密码</font> 为空或不符合相关规则！<br>"
  else
    if password<>password2 then
      red=red&err_head&"您输入的 <font class=time>登陆密码</font> 和 <font class=time>确认密码</font> 不一致！<br>"
    end if
  end if
  if symbol_name(passwd)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>密码钥匙</font> 为空或不符合相关规则！<br>"
  end if
  end if
end if
if trim(request.form("power"))="user" then	
    if objv7.web_var(web_reg,4)=1 then
	Randomize
	Do While Len(rndnum)<8
	num1=CStr(Chr((57-48)*rnd+48))
	rndnum=rndnum&num1
	loop
	password=jk_md5(rndnum,"short")
	passwd=jk_md5(rndnum,"short")
	else
  if symbol_ok(password)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>登陆密码</font> 为空或不符合相关规则！<br>"
  else
    if password<>password2 then
      red=red&err_head&"您输入的 <font class=time>登陆密码</font> 和 <font class=time>确认密码</font> 不一致！<br>"
    end if
  end if
  if symbol_name(passwd)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>密码钥匙</font> 为空或不符合相关规则！<br>"
  end if
  end if
end if	
  if objv7.email_ok(email)<>"yes" or len(email)>50 then
    red=red&err_head&"您输入的 <font class=time>E-mail</font> 为空或不符合邮件规则！<br>"
  end if
  if val_code(3)<>"yes" then
    red=red&err_head&"您输入的 <font class=time>验 证 码</font> 为空或有错误！<br>"
  end if
  
  if red="" then
    sql="select * from user_data where username='" & username & "' or email='" & email & "'"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    if rs.eof and rs.bof then
      rs.addnew
      rs("username")=username
'===黄金会员注册
if trim(request.form("power"))<>"user" then
if objv7.web_var(web_reg,16)=1 then
   rs("password")=jk_md5(rndnum,"short")
   password=rndnum
   rs("passwd")=jk_md5(rndnum,"short")
   passwd=rndnum
else
   rs("password")=jk_md5(password,"short")
   rs("passwd")=jk_md5(passwd,"short")
end if
end if

'===免费会员注册
if trim(request.form("power"))="user" then
if objv7.web_var(web_reg,4)=1 then
   rs("password")=jk_md5(rndnum,"short")
   password=rndnum
   rs("passwd")=jk_md5(rndnum,"short")
   passwd=rndnum
else
   rs("password")=jk_md5(password,"short")
   rs("passwd")=jk_md5(passwd,"short")
end if
end if
      rs("email")=email
      if trim(request.form("sex"))="girl" then
        rs("sex")=0
      else
        rs("sex")=1
      end if
      rs("face")="0"
      rs("tim")=now_time
      if power<>"" then 
      rs("power")=power
      else
      rs("power")="user"
      end if
      if objv7.web_var(web_reg,9)=1 then
        rs("hidden")=false
        else
        rs("hidden")=true
      end if
      
      rs("bbs_counter")=0
      rs("counter")=0
      rs("dler")=dler
      rs("integral")=objv7.web_var(web_reg,5)
      rs("emoney")=objv7.web_var(web_reg,1)
      rs("usercp")=objv7.web_var(web_reg,2)
      rs("login_num")=0
      rs("last_tim")=now_time
      lasttime=objv7.web_var(web_reg,8)
      rs("lasttime")=now() + lasttime
if trim(request.form("power"))<>"user" then
      rs("popedom")="00000000000000000000000000000000000000000010000000"
else
      rs("popedom")="00000000000000000000000000000000000000000000000000"
end if    
      rs.update
      rs.close:set rs=nothing
      
      conn.execute("update configs set new_username='"&username&"',num_reg=num_reg+1 where id=1")
    dim sender,sbjectmail,mailbody,objmail,subject,ToMailCC,remark
    sender="sczywj@163.com"
    sbjectmail=""&objv7.web_var(web_config,1)&"会员"&username&"注册邮件通知"
   	mailbody="<html>"
	mailbody=mailbody & "<title>注册信息</title>"
	mailbody=mailbody & "<body>"
	mailbody=mailbody & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
	mailbody=mailbody & "<TD valign=middle align=top>"
	mailbody=mailbody & ""&username&"，您好：<br><br>"
	mailbody=mailbody & "欢迎您注册"&objv7.web_var(web_config,1)&"("&email&")，我们将提供给您最好的电影服务！<br>"
	mailbody=mailbody & "下面是您的注册信息：<br>"
	mailbody=mailbody & "注册名："&username&"<br>"
	mailbody=mailbody & "密  码："&password&"<br>"
	mailbody=mailbody & "密码锁："&passwd&"<br><br><br>"
	mailbody=mailbody & "如果有业务联系的事可以加我的QQ: 13441688、43164605 ，<br>让我们一起来建设一个网上家园！</font>"
	mailbody=mailbody & "<br>你的推广代码是:<textarea rows=""1"" name=""S1"" cols=""54"">"&objv7.web_var(web_reg,7)&"/?user="&username&"</textarea><br>只要你把上面的网址发给你QQ上的一个好友，你的观看电影"&objv7.web_var(web_config,8)&"就会增加"&objv7.web_var(web_reg,11)&""&objv7.web_var(web_config,8)&"和"&objv7.web_var(web_reg,10)&"点魅力，两个就"&objv7.web_var(web_reg,11)&" x 2"&objv7.web_var(web_config,8)&",如果你QQ上的好友成为我 们付费会员，你就可以得到10%或者40%的代理费用<br></span></TD></TR></TBODY></TABLE><br><hr width=95% size=1>"
	mailbody=mailbody & "<p align=center><a href="&objv7.web_var(web_config,2)&"><span style=font-size:9pt>"&objv7.web_var(web_config,2)&"</span></a>&nbsp;&nbsp;&nbsp;程序制作：QQ： 13441688、43164605</p>"
	mailbody=mailbody & "</body>"
	mailbody=mailbody & "</html>"
    response.write ""_
      &"<h2>恭喜！会员注册成功,您注册资料的邮件已成功发送到"&email&"</h2>"_
      &""
    set objmail=server.createobject("CDONTS.newmail")
    
  if objv7.web_var(web_reg,4)=1 then
    email=(""&email&",sczywj@163.com")
  else
    email=("sczywj@163.com")
  end if

    objmail.to=email
    objmail.from=sender
    objMail.BodyFormat=0
    objMail.MailFormat=0
    objmail.subject=sbjectmail
    objmail.body=mailbody
    objmail.importance=2
    objmail.send
    set objmail=nothing

      if objv7.web_var_num(web_setup,2,1)=0 then
        reg_chk="<font class=time><b>"&username&"</b></font>，您已成功注册成为本站用户。<br><br>您现在的状态为：<font class=time_3>未审核</font>，请等待管理员的审核。谢谢！"
      else
call regok()

 '-------------自动登录
 dim id,power,hidden,face
  if symbol_name(login_username)="yes" then
    username=login_username
  else
    username=trim(request.form("username"))
  end if
  if symbol_ok(login_password)="yes" then
    password=login_password
  else
    password=trim(request.form("password"))
    password=jk_md5(password,"short")
  end if
        response.cookies(web_cookies)("login_username")=username
        response.cookies(web_cookies)("login_password")=password   
        response.cookies("LOGIN_USER")=username
        response.cookies("LOGIN_USER").expires=date+365
'-------------登录


' reg_chk="恭喜！<font class=time><b>"&username&"</b></font>，您已成功注册成为本站用户。<br><br><a href='login.asp'>现在进行登陆</a><br><br>请尽快登陆并修改您的个人资料。"

send_u="[系統]"
accept_u=request.form("username")
topic="[系统]欢迎你注册"
word=""&objv7.web_var(web_reg,3)&"[br][br]"&username&" 已成功地注册了！本站送你"&objv7.web_var(web_reg,1)&""&objv7.web_var(web_config,8)&"，"&objv7.web_var(web_reg,2)&"魅力，"&objv7.web_var(web_reg,5)&"积分,你的积分也可以换成电影币的"
call mail(send_u,accept_u,topic,word)  

 end if
      exit function
    else
      red=err_head&"您输入的 <font class=time>用户名称或者邮箱地址</font> 已经被注册！<br>" & _
	       err_head&"请重新选择输入您的 <font class=time>用户名称或者邮箱地址</font> 以并继续注册！<br>"
      rs.close:set rs=nothing
      reg_chk=found_error(red,300):exit function
    end if
    rs.close:set rs=nothing
  else
    red=red&err_head&"请查阅有关 <a href='help.asp?action=register' class=time_3>用户注册注意事项</a> 并重新填写。"
    reg_chk=found_error(red,280):exit function
  end if
end function

sub login_chk()
  dim username,password,red,id,power,hidden,face,old_url
  old_url=var_null(request.querystring("old_url"))
  
  if symbol_name(login_username)="yes" then
    username=login_username
  else
    username=trim(request.form("username"))
  end if
  
   '--------限制二人登录
   if objv7.web_var(web_reg,6)=1 then

   dim l_ip,sql2,rs2
    sql2="select * from user_login where l_username='"&username&"'"
    set rs2=conn.execute(sql2)
     if rs2.eof and rs2.bof then            
     else
     l_ip=rs2("l_ip")
            if l_ip<>request.servervariables("remote_addr") then
      response.write"<script>alert('该用户帐号已经登录,禁止同一用户同时多次登陆！如果你有正确密码,请输入密码强制踢他下线!');window.open('help.asp?action=help11');</script>"
      response.end  
            end if
     end if
     end if
   '--------限制二人登录 
  
  if symbol_ok(login_password)="yes" then
    password=login_password
  else
    password=trim(request.form("password"))
    password=jk_md5(password,"short")
  end if

  red=""
  if symbol_name(username)<>"yes" then
    red=red&err_head&"您输入的 <font class=time_3>用户名称</font> 为空或不符合相关规则！<br>"
  end if
  if symbol_ok(password)<>"yes" then
    red=red&err_head&"您输入的 <font class=time_3>登陆密码</font> 为空或不符合相关规则！<br>"
  end if

  if red="" then
    sql="select top 1 id,face,power,hidden,uip,lasttime from user_data where username='"&username&"' and password='"&password&"'"
    set rs=conn.execute(sql)
    if rs.eof and rs.bof then
      red=err_head&"您输入的 <font class=time>用户名称</font> 和 <font class=time>登陆密码</font>  有错误！<br>" & _
	       err_head&"请重新输入以并继续登陆本站！"
      response.write found_error(red,260)
    else
    
       power=rs("power"):hidden=rs("hidden")
      if rs("uip")="" then
      else
      if rs("uip")<>request.servervariables("remote_addr") then
      response.write"<script>alert('你现在的IP是"&request.servervariables("remote_addr")&"  该用户帐号已经限制 IP= "&rs("uip")&" 登录,禁止同一用户同时在不同IP多次登陆！请向管理员"&objv7.web_var(web_config,3)&"联系');window.open('gbook.asp');</script>"
      response.end  
      end if
      end if
      
      power=rs("power"):hidden=rs("hidden")
      if hidden=true then
        response.cookies(web_cookies)("time_load")=DateAdd("s",-5,now_time)
        response.cookies(web_cookies).path=objv7.web_var(web_config,4)
        response.cookies(web_cookies)("login_username")=username
        response.cookies(web_cookies)("login_password")=jk_encrypt(password)

        sql="update user_data set last_tim='"&now_time&"' where username='"&username&"'"
        conn.execute(sql)
        tit=request.cookies(web_cookies)("guest_name")
        if var_null(tit)<>"" then
          conn.execute("delete from user_login where l_username='"&tit&"'")
        end if
        
        if trim(request.form("memery_info"))="yes" then
	  response.cookies(web_cookies)("iscookies")="yes"
	  response.cookies(web_cookies).expires=date+365
        end if
        call cookies_yes()
        '----------------------------------------------------------------------------
        if old_url<>"" then
	  rs.close:set rs=nothing:call close_conn()
	  call format_redirect(old_url)
	  response.end
        end if
	'----------------------------------------------------------------------------
	if trim(request.form("re_log"))="yes" and len(request.servervariables("http_referer"))>3 then
	  rs.close:set rs=nothing:call close_conn()
	  call format_redirect(request.servervariables("http_referer"))
	  response.end
	end if
	'----------------------------------------------------------------------------
	
	response.write "<meta http-equiv='refresh' content='"&objv7.web_var(web_num,5)&"; url="&index_url&".asp'><br><br><br>你好，<font class=time>"&username&"</font>&nbsp;你现在是 <font class=time>"&objv7.format_power(user_power,power,1)&"</font> 登陆模式<br><br>" & _
		       vbcrlf & "<a href='"&index_url&".asp'>进入"&tit_fir&"</a>&nbsp;┋&nbsp;<a href='login.asp?action=logout'>退出本次登陆</a><br><br><br>"
      
      
      
      else
        response.write "<font class=time>您的用户帐号还未审核！</font><br><br>请与管理员联系。"
      end if
    end if
    rs.close
  else
    red=red&err_head&"请查阅有关 <a href='help.asp?action=register' class=time_3>用户注册注意事项</a> 并重新填写。"
    response.write found_error(red,280)
  end if
end sub

sub login_main()
  dim old_url
  old_url=var_null(request.querystring("old_url"))
  if old_url<>"" then old_url="&old_url="&old_url
response.write admin_bar("用户注册",1,"280")
%>
<table border=0 align=center>
<form name=login_frm method=post action='login.asp?action=login_chk<%response.write old_url%>' onsubmit="return login_true()">
<tr><td align=center height=30>用户名称：&nbsp;<input type=text name=username size=15 maxlength=20 tabindex=1 class=inputbg>&nbsp;&nbsp;</td></tr>
<tr><td align=center>登陆密码：&nbsp;<input type=password name=password size=15 maxlength=20 tabindex=2 class=inputbg>&nbsp;&nbsp;</td></tr>
<tr><td align=center height=30 align=center><input type=radio name=memery_info value='no'>&nbsp;登陆一次&nbsp;
<input type=radio name=memery_info value='yes' checked>&nbsp;永久登陆</td></tr>
<tr><td align=center>
<input type=button value='注 册' onClick="document.location='login.asp?action=register'" class=inputbg>&nbsp;&nbsp;
<input type=button value='忘记密码' onClick="document.location='login.asp?action=nopass'" class=inputbg>&nbsp;&nbsp;
<input type=submit value='登 陆' tabindex=3 class=inputbg>
</td></tr>
</table>
<%
response.write admin_bar("",2,"280")
end sub
%>

<%sub regok()%>
<table border="0" cellpadding="8" cellspacing="1" width="607">
<tr> 
<td width="180" bgcolor="#9FD6F8" align="right">
<font color="#800000">登录ID：</font></td>
<td width="425" bgcolor="#9FD6F8"> 
<font color="#800000"> 
<input type=text name=username size=26 class=flat1 style="background-color: #9FD6F8; border: 0px solid #000000; " value="<%=request.form("username")%>">
<input type=password name=password size=1 class=flat1 style="background-color: #9FD6F8; border: 0px solid #000000; " value="<%=password%>"></font></td></tr><tr> <td width="180" bgcolor="#b4def8" align="right"><p>
<font color="#800000">E&nbsp; -mail：</font></td><td width="425" bgcolor="#b4def8"><%=request.form("Email")%></td></tr> <tr> <td width="180" bgcolor="#9FD6F8" align="right">
<font color="#800000">性别：</font></td>
<td width="425" bgcolor="#9FD6F8"><%=request.form("Sex")%></td></tr><tr> 
<td width="180" bgcolor="#b4def8" align="right"><font color="#800000">姓名：</font></td>
<td width="425" bgcolor="#b4def8">
                            <p align="left"> 
                              <font color="#800000"> 
                              <%if request.form("nName")="" then%>未填写 <%else%><%=request.form("nName")%> <%end if%>
                              </font>
                            </td>
                          </tr>
                          <tr> 
                            <td width="180" bgcolor="#b4def8" align="right">
                            <p><font color="#800000">你的Q&nbsp; 
                            Q：</font></td>
                            <td width="425" bgcolor="#b4def8">
                            <p align="left"> 
                              <font color="#800000"> 
                              <%if request.form("qq")="" then%>未填写 
                              <%else%>
                              <%=request.form("qq")%> 
                              <%end if%> </font>
                            </td>
                          </tr>
                          <tr>
                            <td width="180" bgcolor="#9FD6F8" align="right">
                            <p><font color="#800000">会员类别：</font></td>
                            <td width="425" bgcolor="#9FD6F8"><%
                            power=request.form("power")
                            response.write objv7.format_power(user_power,power,1)%>
                            </td>
                          </tr><%if request.form("power")="user" then%> </font>
                          <tr>
                            <td width="180" bgcolor="#9FD6F8" align="right">
                            <p><font color="#800000">会员注意事项：</font></td>
                            <td width="425" bgcolor="#9FD6F8"> 
<font color="#800000">1.推广代码<br><textarea rows="2" name="S1" cols="55"><%response.write objv7.web_var(web_reg,7)%>/?user=<%=request.form("username")%></textarea><br>&nbsp;只要你把上面的网址发给你QQ上的一个好友，你的观看电影<%response.write objv7.web_var(web_config,8)%>就会增加<%response.write objv7.web_var(web_reg,11)%><%response.write objv7.web_var(web_config,8)%>和<%response.write objv7.web_var(web_reg,10)%>点魅力，两个就<%response.write objv7.web_var(web_reg,11) * 2%><%response.write objv7.web_var(web_config,8)%></font><p>
<font color="#800000">付费会员:<%response.write objv7.web_var(web_lst,2)%>元/月，<%response.write objv7.web_var(web_lst,3)%>元/3个月 <%response.write objv7.web_var(web_lst,4)%>元/6个月&nbsp; <%response.write objv7.web_var(web_lst,6)%>元/12个月</font></p>
<p>
<font color="#800000">2.</font><a target="_blank" href="ff.asp"><font color="#800000">点击这里进行在线支付升级成为本站的特别会员</font></a><p>
<font color="#800000">3.</font><a href="ff.asp"><font color="#800000">马上进入在线支付购买点卡</font></a></td>
</tr>
<%else%>
<font color="#800000">
<%sql="insert into user_mail(send_u,accept_u,topic,word,tim,types,isread) " & _
"values('[系统]','"&objv7.web_var(web_config,3)&"','[系统]"&objv7.format_power(user_power,power,1)&"["&request.form("username")&"]注册成功','[url=admin_login.asp]后台管理[/url]！','"&now_time&"',1,0)"
conn.execute(sql)%> </font><tr> <td width="180" bgcolor="#9FD6F8" align="right">
<p><font color="#800000">会员注意事项：</font></td>
<td width="425" bgcolor="#9FD6F8"> 
<font color="#800000">1.推广代码<br><textarea rows="2" name="S1" cols="54"><%response.write objv7.web_var(web_reg,7)%>/?user=<%=request.form("username")%></textarea></font><p>
<font color="#800000">2.请和本站站长</font><a href=user_message.asp?action=write&accept_uaername=<%=objv7.web_var(web_config,3)%>><font color="#800000"><%=objv7.web_var(web_config,3)%></font></a><font color="#800000">联系开通你的
特定会员帐号</font><p>
<a href="ff.asp"><font color="#800000">3.马上进入在线支付，快速开通你的帐号!!</font></a><p>
<font color="#800000">
网吧或其他需要特定服务的用户，根据IP开一个或多个特定的帐户，只限于在该IP范围内使用，并且帐户在该IP内的无须再次登陆即可观看电影。<br>
正式会员：没有浏览次数的限制，但不提供下载服务。分为<%response.write objv7.web_var(web_lst,5)%>元/月 <%response.write objv7.web_var(web_lst,12)%>元/3个月 <%response.write objv7.web_var(web_lst,13)%>元/6个月 <%response.write objv7.web_var(web_lst,14)%>元/12个月<br>
高级会员：没有浏览次数的限制同时提供下载服务（无限制）。高级会员登陆后在页面左侧的用户服务导航中有一个“下载专区”，分为<%response.write objv7.web_var(web_lst,15)%>元/1个月 <%response.write objv7.web_var(web_lst,16)%>元/6个月</font></td>
</tr><%end if%><font color="#800000"> </font>
<tr> <td width="605" bgcolor="#67BDF1" align="center" colspan="2"> 
<%if objv7.web_var(web_reg,4)=1 then%><font color="#800000">您的注册信息和密码已经发往您的邮箱，请使用系统给您的密码登陆<%else%></font><a href='ff.asp?power=<%=request.form("power")%>'><font color="#800000">现在进入网站在线支付系统付费</font></a><font color="#800000"><%end if%></font></td>
                          </tr>
                      </table>
<%end sub%>
<%
sub login_kicp()
  dim username,password,red,id,power,hidden,face
  if symbol_name(login_username)="yes" then
    username=login_username
  else
    username=trim(request.form("username"))
  end if
  if symbol_ok(login_password)="yes" then
    password=login_password
  else
    password=trim(request.form("password"))
    password=jk_md5(password,"short")
  end if
  red=""
  if symbol_name(username)<>"yes" then
    red=red&err_head&"您输入的 <font class=red_3>用户名称</font> 为空或不符合相关规则！<br>"
  end if
  if symbol_ok(password)<>"yes" then
    red=red&err_head&"您输入的 <font class=red_3>登陆密码</font> 为空或不符合相关规则！<br>"
  end if

  if red="" then
    sql="select top 1 id,face,power,hidden from user_data where username='"&username&"' and password='"&password&"'"
        set rs=conn.execute(sql)
    if rs.eof and rs.bof then
      red=err_head&"您输入的 <font class=red>用户名称</font> 和 <font class=red>登陆密码</font>  有错误！<br>" & _
	       err_head&"请重新输入以并继续登陆本站！"
      response.write found_error(red,260)
    else
      power=rs("power"):hidden=rs("hidden")
      if hidden=true then
        'response.cookies(web_cookies).path=web_path
        response.cookies(web_cookies)("login_username")=""
        response.cookies(web_cookies)("login_password")=""

        tit=username

          conn.execute("delete from user_login where l_username='"&tit&"'")
        
        if trim(request.form("memery_info"))="yes" then
	  response.cookies(web_cookies)("iscookies")="yes"
	  response.cookies(web_cookies).expires=date+365
        end if
	'----------------------------------------------------------------------------
	if trim(request.form("re_log"))="yes" then
	  call close_conn()
	  response.redirect request.servervariables("http_referer")
	  response.end
	end if
	'----------------------------------------------------------------------------
   response.write "<font class=red>成功踢下线!请重新登录改密码!如果发现多次出现多个不同IP用户登录同一帐号者有可能删该帐号</font>"
	call login_main()
      else
        response.write "<font class=red>您的用户帐号还未审核！</font><br><br>请与管理员联系。"
      end if
    end if
    rs.close
  else   
    red=red&err_head&"请查阅有关 <a href='help.asp?action=register' class=red_3>用户注册注意事项</a> 并重新填写。"
    response.write found_error(red,280)
  end if
end sub
%>