function TEMPLATE_SET()
{
    $kav = new Kav4Proxy();
    $_POST["data"] = stripslashes($_POST["data"]);
    if ($kav->set_template($_POST["TEMPLATE_SET"], $_POST["data"])) {
        $tpl = new templates();
        echo $tpl->javascript_parse_text("{success}");
    }
}
Exemple #2
0
function umountfs()
{
    $unix = new unix();
    $mount = $unix->find_program("mount");
    $umount = $unix->find_program("umount");
    $kav = new Kav4Proxy();
    if ($kav->is_tmpfs_mounted()) {
        echo "Starting......: Kav4proxy unmounting filesystem\n";
        shell_exec("{$umount} -f /tmp/Kav4proxy");
        shell_exec("/bin/rm -rf /tmp/Kav4proxy");
    }
}
<?php

if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.kav4proxy.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
$kav = new Kav4Proxy();
$conf = $kav->build_config();
echo "Starting......: Kav4proxy building configuration done\n";
@file_put_contents("/etc/opt/kaspersky/kav4proxy.conf", $conf);
function build()
{
    $unix = new unix();
    $DIRS[] = "/var/run/kav4proxy";
    $DIRS[] = "/etc/opt/kaspersky";
    $DIRS[] = "/tmp/Kav4proxy";
    $DIRS[] = "/var/log/kaspersky/kav4proxy";
    $DIRS[] = "/var/log/artica-postfix/ufdbguard-blocks";
    $DIRS[] = "/opt/kaspersky/kav4proxy/share/notify";
    while (list($none, $path) = each($DIRS)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Permissions on {$path}\n";
        }
        @mkdir("{$path}", 0755, true);
        $unix->chown_func("kluser", "klusers", $path);
    }
    $kav = new Kav4Proxy();
    $conf = $kav->build_config();
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Building /etc/opt/kaspersky/kav4proxy.conf done\n";
    }
    @file_put_contents("/etc/opt/kaspersky/kav4proxy.conf", $conf);
    $kav->LoadTemplates();
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} " . count($kav->templates_data) . " templates\n";
    }
    while (list($templateName, $val) = each($kav->templates_data)) {
        if (is_array($val)) {
            echo "Warning {$templateName}: val is array\n";
        }
        if (strlen($val) < 100) {
            echo "Warning {$templateName}: val lenght is not supported!\n";
        }
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} building \"{$templateName}\" template\n";
        }
        @file_put_contents("/opt/kaspersky/kav4proxy/share/notify/{$templateName}", $val);
        @chmod("/opt/kaspersky/kav4proxy/share/notify/{$templateName}", 0755);
        @chown("/opt/kaspersky/kav4proxy/share/notify/{$templateName}", "kluser");
    }
}
Exemple #5
0
function icapserver_engine_options_save()
{
    $kav = new Kav4Proxy();
    $sock = new sockets();
    $sock->SET_INFO("Kav4ProxyTMPFS", $_GET["Kav4ProxyTMPFS"]);
    $sock->SET_INFO("Kav4ProxyTMPFSMB", $_GET["Kav4ProxyTMPFSMB"]);
    $kav->MOD("icapserver.filter", "MaxReqLength", $_GET["MaxReqLength"]);
    $kav->MOD("icapserver.protocol", "PreviewSize", $_GET["PreviewSize"]);
    $kav->MOD("icapserver.process", "MaxChildren", $_GET["MaxChildren"]);
    $kav->MOD("icapserver.process", "IdleChildren", $_GET["IdleChildren"]);
    $kav->MOD("icapserver.process", "MaxReqsPerChild", $_GET["MaxReqsPerChild"]);
    $kav->MOD("icapserver.process", "MaxEnginesPerChild", $_GET["MaxEnginesPerChild"]);
    $kav->MOD("icapserver.network", "ListenAddress", "{$_GET["ListenAddress"]}:1344");
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?kav4proxy-reconfigure=yes");
}
Exemple #6
0
function icapserver_engine_options_save()
{
    $kav = new Kav4Proxy();
    $sock = new sockets();
    $sock->SET_INFO("Kav4ProxyTMPFS", $_GET["Kav4ProxyTMPFS"]);
    $sock->SET_INFO("Kav4ProxyTMPFSMB", $_GET["Kav4ProxyTMPFSMB"]);
    $Rev88Opts["MaxNestingLevel"] = 8;
    $Rev88Opts["DetectVirware"] = 1;
    $Rev88Opts["DetectTrojware"] = 1;
    $Rev88Opts["DetectMalware"] = 1;
    $Rev88Opts["DetectAdware"] = 1;
    $Rev88Opts["DetectPornware"] = 1;
    $Rev88Opts["DetectRiskware"] = 1;
    $Rev88Opts["DetectXfiles"] = 0;
    $Rev88Opts["DetectSoftware"] = 0;
    while (list($fieldname, $default) = each($Rev88Opts)) {
        if (isset($_GET[$fieldname])) {
            $kav->MOD("icapserver.engine.options", $fieldname, $_GET[$fieldname]);
        }
    }
    $kav->MOD("icapserver.filter", "MaxReqLength", $_GET["MaxReqLength"]);
    $kav->MOD("icapserver.protocol", "PreviewSize", $_GET["PreviewSize"]);
    $kav->MOD("icapserver.process", "MaxChildren", $_GET["MaxChildren"]);
    $kav->MOD("icapserver.process", "IdleChildren", $_GET["IdleChildren"]);
    $kav->MOD("icapserver.process", "MaxReqsPerChild", $_GET["MaxReqsPerChild"]);
    $kav->MOD("icapserver.process", "MaxEnginesPerChild", $_GET["MaxEnginesPerChild"]);
    $kav->MOD("icapserver.network", "ListenAddress", "{$_GET["ListenAddress"]}:1344");
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?kav4proxy-reconfigure=yes");
}
Exemple #7
0
function icapserver_engine_options_save()
{
    $kav = new Kav4Proxy();
    $kav->MOD("icapserver.filter", "MaxReqLength", $_GET["MaxReqLength"]);
    $kav->MOD("icapserver.protocol", "PreviewSize", $_GET["PreviewSize"]);
    $kav->MOD("icapserver.process", "MaxChildren", $_GET["MaxChildren"]);
    $kav->MOD("icapserver.process", "IdleChildren", $_GET["IdleChildren"]);
    $kav->MOD("icapserver.process", "MaxReqsPerChild", $_GET["MaxReqsPerChild"]);
    $kav->MOD("icapserver.process", "MaxEnginesPerChild", $_GET["MaxEnginesPerChild"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?kav4proxy-reconfigure=yes");
}