Exemplo n.º 1
0
<?php

$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include_once "{$root}/../include/queries.php";
include_once "{$root}/../include/steam_openid.php";
include_once "{$root}/../include/config.php";
$api_key = file_get_contents("{$root}/../api_key.txt");
$open_id_validate = 0;
if (!empty($_GET['openid_assoc_handle'])) {
    $open_id_validate = SteamSignIn::validate();
}
$steam_open_id_url = SteamSignIn::genUrl();
if ($open_id_validate) {
    $_SESSION["steam_id"] = $open_id_validate;
    query_getUserBySteamID($mysqli, $user_id, $_SESSION["steam_id"]);
    $redirect_page = strtok($_SERVER['REQUEST_URI'], '?');
    if ($user_id == -1) {
        query_createUser($mysqli, $new_user_id, $_SESSION["steam_id"]);
        $_SESSION["user_id"] = $new_user_id;
        $redirect_page = "/profile/";
    } else {
        $_SESSION["user_id"] = $user_id;
    }
    $fetch_string = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $api_key . "&steamids=" . $_SESSION["steam_id"];
    $user_JSON_data = @file_get_contents($fetch_string);
    if ($user_JSON_data === FALSE) {
        header("Location: /error.php");
    }
    $user_data = json_decode($user_JSON_data);
    if (count($user_data->response->players) == 1) {
        $player = $user_data->response->players[0];
<?php

if (!isset($_SESSION['steamID'])) {
    ?>
<a href="<?php 
    include_once "SteamSignIn.class.php";
    $steamSignIn = new SteamSignIn();
    if ($body == true) {
        $url = "https://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_large_noborder.png";
    } else {
        $url = "https://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_small.png";
    }
    if (isset($_GET['return_url'])) {
        echo $steamSignIn->genUrl('http://' . $_SERVER['HTTP_HOST'] . $_GET['return_url']);
    } else {
        echo $steamSignIn->genUrl('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    }
    ?>
"><img src="<?php 
    echo $url;
    ?>
" alt="Login through Steam"></a>
<?php 
}
Exemplo n.º 3
0
<?php

session_start();
require 'func.php';
if (isset($_SESSION['steamlogin'])) {
    $steam_login_verify = $_SESSION['steamlogin'];
} else {
    $steam_login_verify = SteamSignIn::validate();
}
if (!empty($steam_login_verify)) {
    $_SESSION['steamlogin'] = $steam_login_verify;
    echo "<h1>Welcome. <a href=dash.php>Continue</a></h1>";
} else {
    $steam_sign_in_url = SteamSignIn::genUrl();
    echo '

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Signin</title>

    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
Exemplo n.º 4
0
    $infostring = $current_points . " Points";
    if ($past_donations > 0) {
        $infostring .= ", " . dollars($past_donations) . " Donated";
    }
    $players = fetch_steam_info($steamid);
    output_steam_info($steamid, $players, $infostring);
    ?>
		<p style="margin-top:0px;">
			Validated Successfully - <a href="index.php?logout" class="hoverul">Sign Out</a>
		</p>
		<?php 
} else {
    ?>
		<p>
		<a href="<?php 
    echo $steamsignin->genUrl();
    ?>
"><img src="steamsignin.png" class="steambutton" alt="Sign in through Steam"></a>
		<br>
		Click this button to sign in through your Steam account.<br>
		This is only for validation - no private account information will be shared with us!
		</p>
		<?php 
}
?>

	<h2>Step 2: Choose Amount</h2>

	<?php 
function output_fixedamt($price)
{