예제 #1
0
<?php

$include_path = dirname(__FILE__);
require_once $include_path . "/admin/config.inc.php";
require_once $include_path . "/lib/{$DB_CLASS}";
require_once $include_path . "/lib/captcha.class.php";
if (USE_CAPTCHA) {
    if (isset($_GET['id']) && !empty($_GET['id'])) {
        $_GET['id'] = trim($_GET['id']);
        $id = addslashes($_GET['id']);
        $expired = time() - 1200;
        $db = new gbook_sql();
        $db->connect();
        $db->query("DELETE FROM {$GB_TBL["cap"]} WHERE timestamp < {$expired}");
        $res = $db->query("SELECT * FROM {$GB_TBL["cap"]} WHERE session_id='{$id}' LIMIT 1");
        $result = $db->fetch_array($res);
        if (isset($result['validate_key'])) {
            $imageType = "";
            if (extension_loaded("gd")) {
                $img = new SimpleCaptcha();
                $img->setFontSizeRange(14, 18);
                reset($img->supportedImagesTypes);
                $imageType = key($img->supportedImagesTypes);
                $img->setText($result['validate_key']);
            } else {
                require_once $include_path . "/lib/bitmapimagetext.class.php";
                $img = new BitmapImageText();
                $img->setText(strtoupper($result['validate_key']));
            }
            $img->setBackgroundColors(array("EEEEEE", "F2F3D3", "F5EAEA", "E4F3EE", "EEE4F3", "FFE6E6"));
            $img->setTextColors(array("000000", "FD130A", "0A1BFD", "149703", "486C66", "870DC3", "D78406", "105243"));
예제 #2
0
<?php

/* 
   To use this file log in to admin and go to include code
   Grab the include code but change gbinclude.php to blocks.php
   Now place that code where you want the block count to be displayed.
*/
include './admin/config.inc.php';
include './admin/version.php';
include './lib/mysql.class.php';
define('LAZ_TABLE_PREFIX', $table_prefix);
$db = new gbook_sql();
$db->connect();
$stats = $db->fetch_array($db->query('SELECT block_count, offset FROM ' . LAZ_TABLE_PREFIX . '_config'));
date_default_timezone_set($stats['offset']);
$stats = @unserialize($stats['block_count']);
echo $stats[0] . ' spam entries blocked since ' . date('d/m/y', $stats[-1]);
/*
   To change how the date is displayed edit the date
   Go to http://php.net/date to see the various letters you can use for formatting
   
   To display the details of the blocking you can use $stats[x] changing x to a number from this list

   -1 - Timestamp of when spam block count was started/reset
    0  - Total count
    1  - Filled in the Honeypot
    2  - You have banned their IP
    3  - They didn't fill in the anti bot test
    4  - They got the anti bot test wrong
    5  - No timehash
    6  - They failed the header check
예제 #3
0
if (!isset($GB_TBL['cap']) || empty($GB_TBL['cap'])) {
    echo "Please update config.inc.php first.";
    exit;
}
$sqlquery[] = "ALTER TABLE `{$GB_TBL['data']}` CHANGE `browser` `browser` TINYTEXT";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['priv']}` CHANGE `browser` `browser` TINYTEXT";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['data']}` CHANGE `host` `host` VARCHAR(255) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['priv']}` CHANGE `host` `host` VARCHAR(255) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['data']}` CHANGE `email` `email` VARCHAR(100) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['priv']}` CHANGE `email` `email` VARCHAR(100) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['data']}` CHANGE `location` `location` VARCHAR(100) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['priv']}` CHANGE `location` `location` VARCHAR(100) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['com']}` CHANGE `host` `host` VARCHAR(255) DEFAULT NULL";
$sqlquery[] = "ALTER TABLE `{$GB_TBL['com']}` ADD INDEX (`id`)";
$sqlquery[] = "CREATE TABLE {$GB_TBL['cap']} (\n\tsession_id char(32) DEFAULT '' NOT NULL,\n\tvalidate_key varchar(64) NOT NULL,\n\ttimestamp int(11) unsigned NOT NULL,\n\tPRIMARY KEY (session_id)\n)";
$db = new gbook_sql();
$db->connect();
$res = $db->query("SHOW TABLES LIKE '{$GB_TBL['cap']}'");
$result = $db->fetch_array($res);
if ($result == false) {
    echo "Updating db from 2.3.x to 2.4.4 \n\n";
    for ($i = 0; $i < count($sqlquery); $i++) {
        $db->query($sqlquery[$i]);
        echo " - {$sqlquery[$i]}\n";
    }
    echo "------------\n\n Update finished.";
} else {
    echo "No update required.";
}
?>
</xmp>
예제 #4
0
            $hidden = "";
            foreach ($GB_DB as $key => $value) {
                $hidden .= "<input type=\"hidden\" name=\"gbdb[{$key}]\" value=\"" . htmlspecialchars($value) . "\">";
            }
            showAccountForm($hidden);
        }
        break;
    case "change":
        if (isset($_POST['gbdb']) && is_array($_POST['gbdb'])) {
            $_POST['gbdb'] = stripQuotes($_POST['gbdb']);
        }
        $GB_DB["dbName"] = isset($_POST['gbdb']['dbName']) ? $_POST['gbdb']['dbName'] : "";
        $GB_DB["host"] = isset($_POST['gbdb']['host']) ? $_POST['gbdb']['host'] : "";
        $GB_DB["user"] = isset($_POST['gbdb']['user']) ? $_POST['gbdb']['user'] : "";
        $GB_DB["pass"] = isset($_POST['gbdb']['pass']) ? $_POST['gbdb']['pass'] : "";
        $db = new gbook_sql();
        $db->connect();
        if (!empty($_POST['data']['username']) && !empty($_POST['data']['password'])) {
            $username = addslashes($_POST['data']['username']);
            $password = addslashes($_POST['data']['password']);
            $db->query("UPDATE {$GB_TBL['auth']} SET username='******', password=PASSWORD('{$password}') WHERE ID='1'");
            echo "<h3>Username and password changed.</h3>";
        } else {
            echo "<h3>Username or password is empty.</h3>";
        }
        break;
    default:
        showForm();
}
?>
</body>