Exemplo n.º 1
0
/*
 * CC98 登录回调页面
 * 
 * 版本:1.0
 * 作者:樱桃
 * 时间:2014-10-13
 * 
 * 修订记录:
 * 无
 * 
 */
require_once "include/bittorrent.php";
header("Content-Type: text/html; charset=utf-8");
dbconn();
// 资源对象。
$res = get_current_user_resource()['cc98_logon'];
// CC98 登录 APP 的客户端 ID 和机密。
global $cc98_client_id;
global $cc98_client_secret;
global $redirect_uri;
$code = $_GET['code'];
$state_str = $_GET['state'];
// 解密数据,如果解密失败则立即返回错误。
$state = unprotect_data($state_str);
if (!$state) {
    show_system_error();
}
// 参数检查。
if (empty($code)) {
    show_system_error();
}
Exemplo n.º 2
0
<?php

/*
 * 2014-10-14 (樱桃): 增加 CC98 账户关联功能
 */
require "include/bittorrent.php";
dbconn();
// 资源对象
$res = get_current_user_resource()['user_control_panel'];
require_once get_langfile_path();
loggedinorreturn();
function bark($msg)
{
    //stdhead();
    global $lang_usercp;
    stdmsg($lang_usercp['std_sorry'], $msg);
    //stdfoot();
    exit;
}
function usercpmenu($selected = "home")
{
    global $lang_usercp;
    begin_main_frame();
    print "<div id=\"usercpnav\"><ul id=\"usercpmenu\" class=\"menu\">";
    print "<li" . ($selected == "home" ? " class=selected" : "") . "><a href=\"usercp.php\">" . $lang_usercp['text_user_cp_home'] . "</a></li>";
    print "<li" . ($selected == "personal" ? " class=selected" : "") . "><a href=\"?action=personal\">" . $lang_usercp['text_personal_settings'] . "</a></li>";
    print "<li" . ($selected == "tracker" ? " class=selected" : "") . "><a href=\"?action=tracker\">" . $lang_usercp['text_tracker_settings'] . "</a></li>";
    print "<li" . ($selected == "forum" ? " class=selected" : "") . "><a href=\"?action=forum\">" . $lang_usercp['text_forum_settings'] . "</a></li>";
    print "<li" . ($selected == "security" ? " class=selected" : "") . "><a href=\"?action=security\">" . $lang_usercp['text_security_settings'] . "</a></li>";
    print "</ul></div>";
    end_main_frame();
Exemplo n.º 3
0
$send_email = $email;
$email = sqlesc($email);
$country = sqlesc($country);
$gender = sqlesc($gender);
$sitelangid = sqlesc(get_langid_from_langcookie());
$res_check_user = sql_query("SELECT * FROM users WHERE username = "******"INSERT INTO users (username, passhash, secret, editsecret, email, country, gender, status, class, invites, " . ($type == 'invite' ? "invited_by," : "") . " added, last_access, lang, stylesheet" . ($showschool == 'yes' ? ", school" : "") . ", uploaded,ip) VALUES (" . $wantusername . "," . $wantpasshash . "," . $secret . "," . $editsecret . "," . $email . "," . $country . "," . $gender . ", 'pending', " . $defaultclass_class . "," . $invite_count . ", " . ($type == 'invite' ? "'{$inviter}'," : "") . " '" . date("Y-m-d H:i:s") . "' , " . " '" . date("Y-m-d H:i:s") . "' , " . $sitelangid . "," . $defcss . ($showschool == 'yes' ? "," . $school : "") . "," . ($iniupload_main > 0 ? $iniupload_main : 0) . ",'" . getip() . "')") or sqlerr(__FILE__, __LINE__);
$id = mysql_insert_id();
// 发送欢迎消息
// 消息可选参数
$messageParams = array($wantusernameraw, $SITENAME);
$title = MessageFormatter::formatMessage(get_current_user_lang(), get_current_user_resource()['signup']['welcome_message_title'], $messageParams);
$text = MessageFormatter::formatMessage(get_current_user_lang(), get_current_user_resource()['signup']['welcome_message_text'], $messageParams);
send_message(0, $id, $title, $text);
//write_log("User account $id ($wantusername) was created");
$res = sql_query("SELECT passhash, secret, editsecret, status FROM users WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($res);
$psecret = md5($row['secret']);
$ip = getip();
$usern = htmlspecialchars($wantusername);
$title = $SITENAME . $lang_takesignup['mail_title'];
$body = <<<EOD
{$lang_takesignup['mail_one']}{$usern}{$lang_takesignup['mail_two']}({$email}){$lang_takesignup['mail_three']}{$ip}{$lang_takesignup['mail_four']}
<b><a href="http://{$BASEURL}/confirm.php?id={$id}&secret={$psecret}" target="_blank">
{$lang_takesignup['mail_this_link']} </a></b><br />
http://{$BASEURL}/confirm.php?id={$id}&secret={$psecret}
{$lang_takesignup['mail_four_1']}
<b><a href="http://{$BASEURL}/confirm_resend.php" target="_blank">{$lang_takesignup['mail_here']}</a></b><br />