Commit cc9c7fb9 authored by Danny SMc's avatar Danny SMc

Delete pastebin.php

parent 390c7151
<?php
// Import modules
require("modules/database.php");
require("modules/utils.php");
require("modules/preset_emails.php");
// Increment Counter
$accsql2 = "UPDATE `cc__stats` SET `accessed` = accessed + 1 WHERE `id` = 1";
$conn->query($accsql2);
// Increment Counter
$accsql2 = "UPDATE `cc__stats` SET `pastebin` = pastebin + 1 WHERE `id` = 1";
$conn->query($accsql2);
// Set Base URLs
$pastebin_login = 'http://pastebin.com/api/api_login.php';
$pastebin_api = 'http://pastebin.com/api/api_post.php';
$pastebin_raw = 'http://pastebin.com/api/api_raw.php';
// Set Application Details
$api_dev_key = '0b26e1ee64f8d06579962e6c42b078ef';
$users = 'cc__users';
// Get command
$cmd = checkString($_POST['cmd']);
switch ($cmd) {
case 'oauth':
// Get username & password
$key = checkString($_POST['key']);
if (validatekey($key)) {
$api_user_name = urlencode($_POST['puser']);
$api_user_password = urlencode($_POST['ppass']);
$ch = curl_init($pastebin_login);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_dev_key='.$api_dev_key.'&api_user_name='.$api_user_name.'&api_user_password='.$api_user_password.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$response = curl_exec($ch);
if (strlen($response) == "32") {
$sql = "UPDATE `$users` SET `pastebin_key` = '$response' WHERE `authkey` = '$key'";
$res = $conn->query($sql);
if ($conn->affected_rows > 0) {
echo '{["status"]=true;["message"]="Your key has now been added to your account with Discover Network."}';
} else {
echo '{["status"]=false;["error"]="Account was correct could not add key to your account."}';
}
} else {
echo '{["status"]=false;["error"]="There was a problem";["response"]="' .. $response .. '";}';
}
}
break;
case 'list_pastes':
$api_user_key = '';
$api_results_limit = '100';
$url = 'http://pastebin.com/api/api_post.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=list&api_user_key='.$api_user_key.'&api_dev_key='.$api_dev_key.'&api_results_limit='.$api_results_limit.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$response = curl_exec($ch);
echo $response;
break;
default:
echo '{["status"]=true;["error"]="No command supplied"}';
break;
}
// $api_paste_code = 'just some random text you :)'; // your paste text
// $api_paste_private = '0'; // 0=public 1=unlisted 2=private
// $api_paste_name= 'justmyfilename.php'; // name or title of your paste
// $api_paste_expire_date = '10M';
// $api_paste_format = 'php';
// $api_user_key = ''; // if an invalid api_user_key or no key is used, the paste will be create as a guest
// $api_paste_name= urlencode($api_paste_name);
// $api_paste_code= urlencode($api_paste_code);
// $url = 'http://pastebin.com/api/api_post.php';
// $ch = curl_init($url);
// curl_setopt($ch, CURLOPT_POST, true);
// curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=paste&api_user_key='.$api_user_key.'&api_paste_private='.$api_paste_private.'&api_paste_name='.$api_paste_name.'&api_paste_expire_date='.$api_paste_expire_date.'&api_paste_format='.$api_paste_format.'&api_dev_key='.$api_dev_key.'&api_paste_code='.$api_paste_code.'');
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_VERBOSE, 1);
// curl_setopt($ch, CURLOPT_NOBODY, 0);
// $response = curl_exec($ch);
// echo $response;
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment