Exemplo n.º 1
0
		FLIR.elURLCache = <?php 
        echo json_encode($cache_data);
        ?>
;
		FLIRStyle.prototype.origURL = FLIRStyle.prototype.URL;
		FLIRStyle.prototype.URL = function(o, text) {
			var id = o.flirId.split('-')[1];
//			console.log('Supercache URL firing');
			if(typeof FLIR.elURLCache == 'undefined' || typeof FLIR.elURLCache[id] == 'undefined') {
//				console.info('Generating URL');
				return this.origURL(o, text)+'&i='+id;
			}else {
//				console.info('URL cached');
				return FLIR.elURLCache[id]['F'];
			}
		};
	} 
};
FLIR.install(FLIRSuperCache);
</script>
<?php 
    }
    // if !isset($_GET['_supercache_refresh'])
} elseif (preg_match('#^\\d+$#', $_GET['i'])) {
    // if($OUTPUT_CACHE_DATA) {
    $cache_file = get_cache_fn(md5(substr(strstr($_SERVER['HTTP_REFERER'], '://'), 3)), 'txt');
    $cache_data = unserialize(file_get_contents($cache_file));
    $cache_data[$_GET['i']] = array('F' => $FLIR['cache'], 'M' => $FLIR['file_meta']);
    file_put_contents($cache_file, serialize($cache_data));
}
// if($OUTPUT_CACHE_DATA) {
Exemplo n.º 2
0
<?php

// a plugin that will limit the number of requests an IP can make per set amount of time
$SETTINGS = array_merge(array('max-unique-permin' => 30, 'ip-timeout' => 1, 'unmetered-time' => 10, 'enable-banlist' => 'true', 'ban-count' => 10, 'ban-time' => 7), $SETTINGS);
$SETTINGS['max-unique-permin'] = $SETTINGS['max-unique-permin'] / 60;
$IP = $_SERVER['REMOTE_ADDR'];
$REQMD5 = md5(urldecode($_SERVER['REQUEST_URI']));
$IPDB = get_cache_fn(md5('ddoslimit-' . substr($IP, 0, strrpos($IP, '.'))), 'txt');
if (!file_exists($IPDB)) {
    file_put_contents($IPDB, serialize(array()));
}
$IPDATA = unserialize(file_get_contents($IPDB));
if ($SETTINGS['enable-banlist'] == 'true') {
    $BANLIST = get_cache_fn(md5('ddoslimitbanlist-' . substr($IP, 0, strrpos($IP, '.'))), 'txt');
    if (!file_exists($BANLIST)) {
        file_put_contents($BANLIST, serialize(array()));
    }
    $BANLISTDATA = unserialize(file_get_contents($BANLIST));
    if (isset($BANLISTDATA[$IP])) {
        if ($BANLISTDATA[$IP] == -1) {
            die('You are banned. Stop.');
        } elseif (time() <= $BANLISTDATA[$IP]) {
            die('You are banned.');
        } elseif (time() > $BANLISTDATA[$IP]) {
            unset($BANLISTDATA[$IP]);
            // ban lifted
            file_put_contents($BANLIST, serialize($BANLISTDATA));
        }
    }
}
if (isset($IPDATA[$IP])) {
Exemplo n.º 3
0
    if ($spaces > 0) {
        $FLIR['text'] = space_out($FLIR['text'], $spaces);
        define('SPACING_GAP', $spaces);
    }
    if ($FLIR['postscript']) {
        $FLIR['ps']['kerning'] = $FStyle['cSpacing'] / $FLIR['size'] * 1000;
    }
}
if ($FLIR['postscript'] && isset($FStyle['space_width'])) {
    $FLIR['ps']['space'] = $FStyle['space_width'] / $FLIR['size'] * 1000;
}
if (($SPACES_COUNT = substr_count($FLIR['text'], ' ')) == strlen($FLIR['text'])) {
    if (false === $SPACE_BOUNDS) {
        $SPACE_BOUNDS = bounding_box(' ');
    }
    $FLIR['cache'] = get_cache_fn(md5($FLIR['font'] . $FLIR['size'] . $SPACES_COUNT));
    $FLIR['mode'] = 'spacer';
}
if (file_exists($FLIR['cache']) && !DEBUG) {
    output_file($FLIR['cache']);
} else {
    verify_gd();
    $REAL_HEIGHT_BOUNDS = $FStyle['realFontHeight'] == 'true' ? bounding_box(HBOUNDS_TEXT, false !== $FONT_PARENT ? $FONT_PARENT : $FLIR['font']) : false;
    switch ($FLIR['mode']) {
        default:
            $dir = dir(PLUGIN_DIR);
            $php_mode = strtolower($FLIR['mode'] . '.php');
            while (false !== ($entry = $dir->read())) {
                $p = PLUGIN_DIR . '/' . $entry;
                if (is_dir($p) || $entry == '.' || $entry == '..') {
                    continue;