コード例 #1
0
function build()
{
    $kav = new Kav4Proxy();
    $conf = $kav->build_config();
    echo "Starting......: Kav4proxy building configuration done\n";
    @file_put_contents("/etc/opt/kaspersky/kav4proxy.conf", $conf);
    shell_exec("/bin/chown -R kluser /etc/opt/kaspersky");
    shell_exec("/bin/chown -R kluser /var/log/kaspersky/kav4proxy");
}
コード例 #2
0
ファイル: exec.kav4proxy.php プロジェクト: BillTheBest/1.6.x
function build()
{
    $kav = new Kav4Proxy();
    $conf = $kav->build_config();
    echo "Starting......: " . date("H:i:s") . " Kav4proxy building configuration done\n";
    @file_put_contents("/etc/opt/kaspersky/kav4proxy.conf", $conf);
    shell_exec("/bin/chown -R kluser /etc/opt/kaspersky");
    shell_exec("/bin/chown -R kluser /var/log/kaspersky/kav4proxy");
    @mkdir("/tmp/Kav4proxy", 0777);
    @chmod("/tmp/Kav4proxy", 0777);
    @chown("/tmp/Kav4Proxy", "kluser");
    @chgrp("/tmp/Kav4Proxy", "kluser");
    templates();
}
コード例 #3
0
<?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);
コード例 #4
0
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");
    }
}