Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once(__DIR__. "/../steamauth/SteamAuth.class.php");
- require("inc/paypal.class.php");
- $global_settings = array(
- "db_host" => "HOST", // Host bazy danych
- "db_user" => "USER", // Uzytkownik bazy danych
- "db_pass" => "PASSWORD", // Haslo bazy danych
- "db_name" => "DB_NAME", // Nazwa bazy danych
- "license_key" => "0000-0000-0000-0000" // Twój klucz licencyjny otrzymany po zakupie
- );
- $db = new mysqli($global_settings["db_host"], $global_settings["db_user"], $global_settings["db_pass"], $global_settings["db_name"]);
- $license_key = $global_settings["license_key"];
- if (mysqli_connect_errno() != 0){
- die("Błąd połączenia z bazą danych: " . mysqli_connect_error());
- }
- $db->query("SET NAMES utf8");
- $auth = new SteamAuth($db, $license_key);
- $apikey = $auth->info("apikey");
- $config["title"] = $auth->info("title");
- $config["desc"] = $auth->info("desc");
- $settings["userid"] = $auth->info("msms_id");
- $settings["serviceid"] = $auth->info("msms_serviceid");
- $settings["text"] = $auth->info("msms_txt");
- $config["msms_psc_pin"] = $auth->info("msms_psc_pin");
- $config["pp_email"] = $auth->info("paypal_email");
- $config["p24_merchant_id"] = $auth->info("p24_merchant_id");
- $config["p24_pos_id"] = $auth->info("p24_pos_id");
- $config["p24_crc"] = $auth->info("p24_crc");
- $config["p24_type"] = $auth->info("p24_type");
- $auth->SetOnLoginCallback(function($steamid){
- global $db;
- $query = $db->query("SELECT * FROM accounts WHERE steamid = '".$steamid."'");
- if($query->num_rows > 0) {
- header("Location: /sklep/");
- } else {
- $db->query("INSERT INTO accounts (steamid) VALUES('".$steamid."')");
- header("Location: /sklep/");
- }
- return true;
- });
- $auth->Init();
- if($auth->IsUserLoggedIn()){
- $auth->getData($_SESSION["steamid"]);
- $userData = $auth->userData();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement