コード例 #1
0
function ppf_http_post($request, $host, $path, $port = 80)
{
    global $pixelpost_db_prefix;
    $pp_user_agent = "Pixelpost/" . Get_Pixelpost_Version($pixelpost_db_prefix) . " | Akismet/1.12";
    $http_request = "POST {$path} HTTP/1.0\r\n";
    $http_request .= "Host: {$host}\r\n";
    $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n";
    $http_request .= "Content-Length: " . strlen($request) . "\r\n";
    $http_request .= "User-Agent: {$pp_user_agent}\r\n";
    $http_request .= "\r\n";
    $http_request .= $request;
    $response = '';
    if (false !== ($fs = fsockopen($host, $port, $errno, $errstr, 30))) {
        fwrite($fs, $http_request);
        while (!feof($fs)) {
            $response .= fgets($fs, 1160);
        }
        // One TCP-IP packet
        fclose($fs);
        $response = explode("\r\n\r\n", $response, 2);
    }
    return $response;
}
コード例 #2
0
        }
    }
}
// if the field does not exist: Create it!
if ($fieldexists == 0) {
    $result = mysql_query("ALTER TABLE {$table} ADD `akismet_key` VARCHAR( 50 ) DEFAULT '' NOT NULL\t");
}
// if the akismet_keep field does not exist, create it
if (!mysql_query("SELECT akismet_keep from " . $pixelpost_db_prefix . "config")) {
    mysql_query("ALTER TABLE " . $pixelpost_db_prefix . "config ADD `akismet_keep` INT DEFAULT '7' NOT NULL ") or die('<span style="color:red"><b>Error: ' . mysql_error());
}
$key = $cfgrow['akismet_key'];
global $pp_api_host, $pp_api_port, $pp_user_agent;
$pp_api_host = $key . '.rest.akismet.com';
$pp_api_port = 80;
$pp_user_agent = "Pixelpost/" . Get_Pixelpost_Version($pixelpost_db_prefix) . " | Akismet/1.12";
$addon_description = "<a name='akismet'></a>Pixelpost Add-On to filter spam using Akismet (<a href='http://akismet.com' target='_blank'>Info</a>).";
function akismet_settings()
{
    global $pixelpost_db_prefix, $cfgrow;
    $newakismet_key = $cfgrow['akismet_key'];
    $newakismet_keep = $cfgrow['akismet_keep'];
    if (isset($_GET['optaction']) && $_GET['optaction'] == "updateantispam") {
        $newakismet_key = mysql_real_escape_string($_POST['newakismet_key']);
        $newakismet_keep = $_POST['newakismet_keep'];
        if ('valid' == akismet_verify_key($newakismet_key)) {
            $query = "update " . $pixelpost_db_prefix . "config set akismet_key='" . $newakismet_key . "'";
            $update = mysql_query($query);
            $addon_description .= "<font color='#006600'>API key validated succesfully.</font>";
        } else {
            $addon_description .= "<font color='#FF0000'>Unable to validate API Key</font>";
コード例 #3
0
ファイル: index.php プロジェクト: RoseySoft/pixelpost
    error_reporting(E_ALL ^ E_NOTICE);
} elseif (isset($_GET['errorsall']) && $_SESSION["pixelpost_admin"]) {
    error_reporting(E_ALL);
}
require_once "../includes/pixelpost.php";
require_once "../includes/functions.php";
// Pixelpost Version
$version = "MS43LjEgKEJldHRlciB0aGFuIEV2ZXIpIC0gSmFudWFyeSAyMDA4";
$pixelpost_prefix_used = $pixelpost_db_prefix;
start_mysql('../includes/pixelpost.php', 'admin');
/**
 * Added to allow upgrades
 * This will be 0 for clean install, 1.3 for that version, 1.4+ for newer versions...
 *
 */
$installed_version = Get_Pixelpost_Version($pixelpost_db_prefix);
if ($installed_version < 1.71) {
    header("Location: install.php");
    exit;
}
// Changed to allow upgrades
if ($cfgquery = mysql_query("SELECT * FROM `" . $pixelpost_db_prefix . "config`")) {
    $cfgrow = mysql_fetch_assoc($cfgquery);
    $upload_dir = $cfgrow['imagepath'];
} else {
    header("Location: install.php");
    exit;
}
/**
 * Always include the default language file (English) if it exists.
 *
コード例 #4
0
    setcookie("pp_user", "", time() - 36000);
    setcookie("pp_password", "", time() - 36000);
    // Finally, destroy the session.
    session_destroy();
    die($message);
}
/**
 * Include supporting functions
 */
require "../includes/pixelpost.php";
require "../includes/functions.php";
start_mysql('../includes/pixelpost.php', 'admin');
/**
 * Check Pixelpost version
 */
if (Get_Pixelpost_Version($pixelpost_db_prefix) < 1.71) {
    die_logout('ERROR: Version Mismatch!');
}
/**
 * Populate the $cfgrow
 */
if ($cfgquery = mysql_query("select * from " . $pixelpost_db_prefix . "config")) {
    $cfgrow = mysql_fetch_assoc($cfgquery);
    $upload_dir = $cfgrow['imagepath'];
} else {
    die_logout('ERROR: Can\'t load config');
}
/**
 * Make the script believe we are actually logged in into the adminpanel
 */
$_POST['user'] = $cfgrow['admin'];