<?php
include dirname(__DIR__) . '/includes/common.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
$zid=intval($_GET['zid']);
$userrow=$DB->getRow("select * from pre_user where zid='$zid' limit 1");
if(!$userrow)exit('当前用户不存在！');
$session=md5($userrow['user'].$userrow['pwd'].$password_hash);
$expiretime=time()+604800;
$token=authcode("{$userrow['user']}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
setcookie("user_token", $token, time() + 604800, '/');
@header('Content-Type: text/html; charset=UTF-8');
exit("<script language='javascript'>window.location.href='../user/';</script>");