<?php
require "../../e/class/connect.php";
require "../../e/class/db_sql.php";
$link=db_connect();
$empire=new mysqlquery;
require "../../e/member/class/user.php";
require "../class/fun.php";
error_reporting(0);
set_magic_quotes_runtime(0);
define('IN_SLUM', 1);
define('SLUM_ROOT', dirname(__FILE__).'/');
define('SLUM_API', strtolower(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));
define('SLUM_DATAURL', SLUM_API.'/');
define('SLUM_SAVEDIR',SLUM_ROOT.'avatar/');
define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
require "header.class.php";
//unset($GLOBALS, $_ENV, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_ENV_VARS);
$_GET		= daddslashes($_GET, 1, TRUE);
$_POST		= daddslashes($_POST, 1, TRUE);
$_COOKIE	= daddslashes($_COOKIE, 1, TRUE);
$_SERVER	= daddslashes($_SERVER);
$_FILES		= daddslashes($_FILES);
$_REQUEST	= daddslashes($_REQUEST, 1, TRUE);
//if($uid!=$bid){ echo 'different';  exit;}

$rid=rand(1,99999);
$m = getgpc('m');
$a = getgpc('a');
	if($m=='user'&&$a=='rectavatar'){
			$data=onrectavatar($rid);
			echo is_array($data)?serialize($data,1) : $data;
	}
	if($m=='user'&&$a=='uploadavatar'){
			$data=onuploadavatar($rid);			
			echo is_array($data)?serialize($data,1) : $data;
	}
?>