function sendAction()
 {
     require_once 'xiaonei.class.php';
     $api_key = $this->_api_key;
     $secret = $this->_secret;
     $xn = new XNapp($api_key, $secret);
     $xn->notifications('send', array('to_ids' => '31445092', 'notification' => '1111111'));
 }
    }
    $row = $result->fetch_object();
    return $row->uid;
}
if (require_session()) {
    if (checkuid($_COOKIE[$API_KEY . "_user"], '1')) {
        $uid = getuid($_COOKIE[$API_KEY . "_user"], '1');
        setcookie('renrenid', $uid, 0);
        header("location:index.php");
    } else {
        $conn = db_connect();
        $uid = $_COOKIE[$API_KEY . "_user"] . "@renren.com";
        $renren_uid = $_COOKIE[$API_KEY . "_user"];
        $query = "insert into wm_cdb_renren_users values('{$uid}','{$renren_uid}','1')";
        if (@$conn->query($query)) {
            $xn = new XNapp($API_KEY, $SECRET_KEY);
            //传进去API_KEY和SECRET_KEY,实例化
            $params = array("uids" => $_COOKIE[$API_KEY . "_user"], "fields" => array('name', 'sex', 'star', 'birthday', 'tinyurl', 'headurl', 'mainurl', 'university_history', 'work_history', 'hs_history', 'hometown_location'), "session_key" => $_COOKIE[$API_KEY . "_session_key"]);
            $result_array = $xn->users('getInfo', $params);
            $name = getValueByKey($result_array, 'name');
            $name = mb_convert_encoding($name, 'gb2312', 'utf-8');
            $qu = "insert into wm_admin_c values('','{$uid}','','{$name}','200',now())";
            if (@$conn->query($qu)) {
                setcookie('renrenid', $uid, 0);
                header("location:index.php");
            } else {
                header("location:error.php");
            }
        }
    }
} else {