<?php
error_reporting(E_ALL ^ E_NOTICE);
define('IN_DISCUZ', true);
header("Content-Type:text/html;charset=gbk");
require_once 'config/config_global.php';
require_once 'config/config_ucenter.php';
require_once 'source/function/function_core.php';
require_once 'source/class/class_core.php';
$discuz = & discuz_core::instance();
$discuz->init();
loadcache('plugin');
global $_G;
$key = $_G['cache']['plugin']['qqrobot']['key'];
$uid=$_GET['uid'];
$time=$_GET['time'];
$sig=$_GET['sig'];
if((TIMESTAMP-$time<30) && $sig == md5("$uid#$time#$key"))
{
	header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
	$cookietime = 31536000;
	$query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
	if($member = DB::fetch($query)) {
		dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
		header("HTTP/1.1 301 Moved Permanently");
		header("location: ".$_G['setting']['discuzurl']);
	}
}
else
	echo('签名错误或登陆链接过期，请重试！');
?>