<?php
    $conf_basedir	= "../../";	//相对主目录的位置
    $conf_where		= "admin";	//选择调用相应模块
    $directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
    include_once($conf_basedir."base.inc.php");
    checkAuth('23');	//判断登录和权限



    if ($uid) {

    $q = "select broker.*,groupname,auth  from broker left join broker_group on groupid=broker_group.id where uid='$uid'";
    $row = $db->GetRow($q);

    $interface_id = md5(uniqid(rand()));

    $mc->add($interface_id, $row, false, 60);
    
    //setcookie("interface_id",$interface_id,time()+3600,"/","house365.com");
	setcookie("conf_citykey", '', time() - 3600);
    
	if(in_array($conf_cityflag,array('hz','wx','sz','xa','hf','cz')))
	{	
		header('Location: http://zsb.house365.com/interface.php?interface_id=' . $interface_id . '&conf_cityflag=' . $conf_cityflag);
        echo 111;exit;
	}else{
		header('Location: http://wa.house365.com/interface.php?interface_id=' . $interface_id . '&conf_cityflag=' . $conf_cityflag);
	}
    exit();
   }

    if ($aid) {
        
        //芜湖站特例
        $whsql = $conf_city == 'wh' ? ",agency.isvip,agency.iscommend,agency.isbest" : "";

        $q = "select account.*,agid,groupname,auth,defuncdate,agentname,postlimit ".$whsql." from account left join agentgroup on account.groupid=agentgroup.id left join agency on account.agentcode=agency.agentcode where uid='$aid'";

        $row = $db->GetRow($q);
        $interface_id = md5(uniqid(rand()));
        $mc->add($interface_id, $row, false, 60);

        setcookie("interface_id", $interface_id, time() + 3600, "/", "house365.com");

        header("Location: {$GB_CITY_AGENTCP_URL}/interface.php");
        exit();
    }
    ?>