<?php require_once 'common.php'; require_session(); $filename = $_SESSION['filename']; header('Content-type: application/pl'); header("Content-Disposition: attachment; filename=\"{$filename}\""); echo $_SESSION['plfile'];
<?php /** * Callback URI for Coinbase OAuth2. * * This is a little hack to allow /coinbase (which will be called as a GET) * to repopulate everything and pass it along to wizard_accounts_post */ $_POST['title'] = require_session("interaction_title"); $_POST['callback'] = 'wizard_accounts_exchanges'; $_POST['type'] = 'coinbase'; $_POST['add'] = true; require __DIR__ . "/wizard_accounts_post.php";
} } function getuid($renren_uid, $status) { // query database for a list of orderinfo $conn = db_connect(); $query = "select uid from wm_cdb_renren_users where renren_uid='{$renren_uid}' and status='{$status}'"; $result = @$conn->query($query); $num_cats = @$result->num_rows; if ($num_cats == 0) { return false; } $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');
if ($password && !is_string($password)) { throw new Exception(t("Invalid password parameter")); } $password2 = $use_password ? require_post("password2", require_get("password2", false)) : false; if ($password2 && !is_string($password2)) { throw new Exception(t("Invalid repeated password parameter")); } $name = require_post("name", require_get("name", require_session("signup_name", false))); $agree = require_post("agree", require_get("agree", require_session("signup_agree", false))); $openid = require_post("openid", require_get("openid", require_post("openid_manual", require_get("openid_manual", false)))); $oauth2 = require_post("oauth2", require_get("oauth2", false)); if ($openid && !is_string($openid)) { throw new Exception(t("Invalid OpenID parameter")); } $subscribe = require_post("subscribe", require_get("subscribe", require_session("signup_subscribe", $openid || $oauth2 ? false : true))); $country = require_post("country", require_get("country", require_session("signup_country", false))); $messages = array(); $errors = array(); unset($_SESSION['signup_name']); unset($_SESSION['signup_email']); unset($_SESSION['signup_country']); unset($_SESSION['signup_agree']); unset($_SESSION['signup_subscribe']); if ($openid || $oauth2 || $password) { if (!$country || strlen($country) != 2) { $errors[] = t("You need to select your country."); } if ($email && !is_valid_email($email)) { $errors[] = t("That is not a valid e-mail address."); } if (!$agree) {