Ejemplo n.º 1
0
$GLOBALS["AS_ROOT"] = false;
if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
$GLOBALS["AS_ROOT"] = true;
if (preg_match("#schedule-id=([0-9]+)#", implode(" ", $argv), $re)) {
    $GLOBALS["SCHEDULE_ID"] = $re[1];
}
include_once dirname(__FILE__) . '/ressources/class.users.menus.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . '/ressources/class.system.network.inc';
include_once dirname(__FILE__) . "/ressources/class.tcpip.inc";
xrun();
function xrun()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $sock = new sockets();
    $SpamAssassinUrlScore = intval($sock->GET_INFO("SpamAssassinUrlScore"));
    $SpamAssassinScrapScore = intval($sock->GET_INFO("SpamAssassinScrapScore"));
    $SpamAssassinSubjectsScore = intval($sock->GET_INFO("SpamAssassinSubjectsScore"));
    if ($SpamAssassinUrlScore == 0) {
        $SpamAssassinUrlScore = 9;
    }
    if ($SpamAssassinScrapScore == 0) {
        $SpamAssassinScrapScore = 6;
    }
    if ($SpamAssassinSubjectsScore == 0) {
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.squid.reports.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.stats.tools.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.syslogs.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
include_once dirname(__FILE__) . '/ressources/whois/whois.main.php';
include_once dirname(__FILE__) . '/ressources/class.artica.graphs.inc';
include_once dirname(__FILE__) . '/ressources/externals/fpdf17/fpdf.php';
if ($argv[1] == "--recategorize") {
    recategorize_tables($argv[2]);
    exit;
}
xrun($argv[1]);
function build_progress($report_id, $text, $pourc)
{
    events("{$pourc}% {$text}");
    $q = new mysql_squid_builder();
    echo "{$pourc}% {$text} Report:[{$report_id}]\n";
    $text = mysql_escape_string2($text);
    $q->QUERY_SQL("UPDATE squid_reports SET report_progress={$pourc}, `report_progress_text`='{$text}' WHERE ID={$report_id}");
}
function events($text)
{
    $pid = getmypid();
    $filename = basename(__FILE__);
    $date = date("H:i:s");
    if (function_exists("debug_backtrace")) {
        $trace = debug_backtrace();