Esempio n. 1
0
function kav4proxy_license()
{
    $unix = new unix();
    $tmpstr = $unix->FILE_TEMP();
    $cmd = "/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager";
    if ($_GET["type"] == "milter") {
        kavmilter_license();
        return;
    }
    if ($_GET["type"] == "kas") {
        kasmilter_license();
        return;
    }
    exec("{$cmd} -s >{$tmpstr} 2>&1");
    $results = explode("\n", @file_get_contents($tmpstr));
    @unlink($tmpstr);
    $results[] = "--------------------------------------------------------------";
    $results[] = basename($cmd);
    $results[] = "--------------------------------------------------------------";
    echo "<articadatascgi>" . base64_encode(implode("\n", $results)) . "</articadatascgi>";
}
Esempio n. 2
0
function kav4proxy_license()
{
    $unix = new unix();
    $tmpstr = $unix->FILE_TEMP();
    $php5 = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    $kav4proxyCache = "/etc/artica-postfix/KAV4PROXY_LICENSE_INFO";
    $cmd = "/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager";
    if ($_GET["type"] == "milter") {
        kavmilter_license();
        return;
    }
    if ($_GET["type"] == "kas") {
        kasmilter_license();
        return;
    }
    if (!is_file($kav4proxyCache)) {
        shell_exec2("{$nohup} {$php5} /usr/share/artica-postfix/exec.kav4proxy.php --license >/dev/null 2>&1 &");
    }
    $results = explode("\n", @file_get_contents($kav4proxyCache));
    $results[] = "--------------------------------------------------------------";
    $results[] = basename($cmd);
    $results[] = "--------------------------------------------------------------";
    echo "<articadatascgi>" . base64_encode(implode("\n", $results)) . "</articadatascgi>";
}
Esempio n. 3
0
function kav4proxy_license()
{
    $unix = new unix();
    $tmpstr = $unix->FILE_TEMP();
    $kav4proxyCache = "/etc/artica-postfix/kav4proxy-licensemanager";
    $cmd = "/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager";
    if ($_GET["type"] == "milter") {
        kavmilter_license();
        return;
    }
    if ($_GET["type"] == "kas") {
        kasmilter_license();
        return;
    }
    if (is_file($kav4proxyCache)) {
        if ($unix->file_time_min($kav4proxyCache) > 2880) {
            exec("{$cmd} -s >{$kav4proxyCache} 2>&1");
        }
    } else {
        exec("{$cmd} -s >{$kav4proxyCache} 2>&1");
    }
    $results = explode("\n", @file_get_contents($kav4proxyCache));
    @unlink($tmpstr);
    $results[] = "--------------------------------------------------------------";
    $results[] = basename($cmd);
    $results[] = "--------------------------------------------------------------";
    echo "<articadatascgi>" . base64_encode(implode("\n", $results)) . "</articadatascgi>";
}
Esempio n. 4
0
function switchTab()
{
    switch ($_GET["tab"]) {
        case "index":
            index();
            exit;
        case "globalsettings":
            GlobalSettings();
            break;
        case "update":
            Update();
            break;
        case "logs":
            kavmilter_events();
            break;
        case "statistics":
            kavmilter_stats();
            break;
        case "license":
            kavmilter_license();
            break;
        default:
            GlobalSettings();
            break;
    }
}