Esempio n. 1
0
 * modify and redistribute it under the terms of the GNU General
 * Public License version 3 as published by the Free Sofware
 * Foundation.
 *
 * @link http://xdccparser.is-fabulo.us/
 * @version 1.2.0
 * @author Alex 'xshadowfire' Yu <*****@*****.**>
 * @author DrX
 * @copyright 2008-2009 Alex Yu and DrX
 */
ignore_user_abort(TRUE);
set_time_limit(0);
require_once 'core.php';
$bots = array();
$access = xp_get("botconfig");
$config = xp_get("config");
$sizes = array('K' => 1.0 / 1024, 'M' => 1, 'G' => 1024, 'T' => 1048576);
foreach ($access as $file) {
    if (function_exists("curl_init") && (stristr($file, "http://") || stristr($file, "ftp://") || stristr($file, "https://"))) {
        $ch = curl_init();
        curl_setopt_array($ch, array(CURLOPT_URL => $file, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_TIMEOUT => 30, CURLOPT_SSL_VERIFYPEER => FALSE));
        if (!($xdccList = curl_exec($ch))) {
            print "ERROR: Unable to fetch remote file {$file}<br />\n";
            print curl_error($ch) . "<br />\n";
            continue;
        }
    } else {
        if (!($xdccList = file_get_contents($file))) {
            print "ERROR: Unable to fetch file {$file}<br />\n";
            continue;
        }
Esempio n. 2
0
// DO NOT EDIT BELOW!!
if (!($_SERVER['PHP_AUTH_USER'] == ADMIN_USER && $_SERVER['PHP_AUTH_PW'] == ADMIN_PASS)) {
    header('WWW-Authenticate: Basic realm="XDCC Parser Admin"');
    header('HTTP/1.0 401 Unauthorized');
    die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access " . $_SERVER['REQUEST_URI'] . " on this server.</p>\n</body></html>\n");
}
require_once 'core.php';
require_once 'smarty/libs/Smarty.class.php';
//initialize smarty
$s = new Smarty();
$s->caching = false;
$s->template_dir = "./tpl";
$s->compile_dir = "./templates_c";
$botconfig = xp_get("botconfig");
$config = xp_get("config");
$bookmarks = xp_get("bookmarks");
$s->assign("skin", $_REQUEST['skin'] ? $_REQUEST['skin'] : SKIN);
if (IRC) {
    $s->assign("irc_chan", IRC_CHANNEL);
    $s->assign("irc_net", IRC_NETWORK);
}
switch ($_REQUEST['do']) {
    case 'editbot':
        if ($botconfig[$_REQUEST['bot']]) {
            $s->assign("edit", $_REQUEST['bot']);
            $s->assign("boturi", $botconfig[$_REQUEST['bot']]);
        }
        $s->display("adminbot.tpl");
        exit;
    case 'editbookmark':
        if ($bookmarks[$_REQUEST['bm_id']]) {
Esempio n. 3
0
 */
require_once 'core.php';
require_once 'smarty/libs/Smarty.class.php';
//figure out url, if needed.
if (!URL) {
    $uri = explode("/", $_SERVER['REQUEST_URI']);
    array_pop($uri);
    define('_URL', "http://" . $_SERVER['SERVER_NAME'] . implode("/", $uri) . "/");
} else {
    define('_URL', URL);
}
//how old is our cache?
if (time() > xp_get("time") + UPDATE_FREQ) {
    file_get_contents(_URL . 'refresh.php', 0, stream_context_create(array('http' => array('timeout' => 0))));
}
$bots = xp_get("bots");
if (isset($_GET['nick'])) {
    header('Content-type: application/rss+xml');
    for ($i = 0; isset($bots[$i]); $i++) {
        if ($bots[$i]['nick'] == $_GET['nick']) {
            echo '<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
		<channel>
		<title>Xdcc Mooo !</title>
		<atom:link href="' . URL . 'rss.php?nick=' . rawurlencode($bots[$i]['nick']) . '" rel="self" type="application/rss+xml"/>
		<link>' . URL . '</link>
		<description></description>
		<language>en</language>';
            for ($j = 0; isset($bots[$i]['packs'][1][$j]); $j++) {
                echo '		<item>
		<title>' . $bots[$i]['packs'][5][$j] . '</title>' . "\n";
Esempio n. 4
0
$s->template_dir = "./tpl";
$s->compile_dir = "./templates_c";
//figure out url, if needed.
if (!URL) {
    $uri = explode("/", $_SERVER['REQUEST_URI']);
    array_pop($uri);
    $_s = '';
    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '' && $_SERVER['HTTPS'] != 'off') {
        $_s = 's';
    }
    define('_URL', "http{$_s}://" . $_SERVER['SERVER_NAME'] . implode("/", $uri) . "/");
} else {
    define('_URL', URL);
}
//assign our vars
$s->assign("url", _URL);
$s->assign("skin", $_REQUEST['skin'] ? $_REQUEST['skin'] : SKIN);
$s->assign("display_sc", DISPLAY_SC);
$s->assign("bots", xp_get("bots"));
$s->assign("bookmarks", xp_get("bookmarks"));
$_GET['search'] ? $s->assign("search", htmlentities(stripslashes($_GET['search']))) : null;
$_GET['nick'] ? $s->assign("nick", $_GET['nick']) : null;
if (IRC) {
    $s->assign("irc_chan", IRC_CHANNEL);
    $s->assign("irc_net", IRC_NETWORK);
}
$s->display("packlist.tpl");
//how old is our cache?
if (time() > xp_get("time") + UPDATE_FREQ) {
    file_get_contents(_URL . 'refresh.php', 0, stream_context_create(array('http' => array('timeout' => 0))));
}