예제 #1
0
function build_whitelist()
{
    $sock = new sockets();
    $unix = new unix();
    $UfdbUseArticaClient = $sock->GET_INFO("UfdbUseArticaClient");
    if (!is_numeric($UfdbUseArticaClient)) {
        $UfdbUseArticaClient = 1;
    }
    if ($UfdbUseArticaClient == 1) {
        build_progress_wb("Use Artica Whitelist", 20);
        $php = $unix->LOCATE_PHP5_BIN();
        system("{$php} /usr/share/artica-postfix/exec.ufdbgclient.whitelists.php");
        return;
    }
    build_progress_wb("{compiling}", 30);
    urlrewriteaccessdeny();
    build_blacklists();
    build_denycaches(true);
    build_progress_wb("{reloading}", 50);
    system("/etc/init.d/squid reload --script=" . basename(__FILE__));
    $sock = new sockets();
    $EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
    if ($EnableTransparent27 == 1) {
        build_progress_wb("{reloading} NAT", 60);
        system("/etc/init.d/squid-nat reload --script=" . basename(__FILE__));
    }
    build_progress_wb("{success}", 100);
}
예제 #2
0
function build_whitelist()
{
    $sock = new sockets();
    $unix = new unix();
    $UfdbUseArticaClient = $sock->GET_INFO("UfdbUseArticaClient");
    if (!is_numeric($UfdbUseArticaClient)) {
        $UfdbUseArticaClient = 1;
    }
    $PrivoxyEnabled = intval($sock->GET_INFO("PrivoxyEnabled"));
    if ($UfdbUseArticaClient == 1) {
        if (!$GLOBALS["NOUFDBG"]) {
            build_progress_wb("* * * Use Whitelist * * *", 20);
            $php = $unix->LOCATE_PHP5_BIN();
            system("{$php} /usr/share/artica-postfix/exec.ufdbgclient.whitelists.php");
        }
        return;
    }
    build_progress_wb("{compiling}", 30);
    urlrewriteaccessdeny();
    build_progress_wb("{building} {blacklists}", 31);
    build_blacklists();
    build_progress_wb("{building} deny cache", 32);
    build_denycaches(true);
    build_progress_wb("{building} {APP_PRIVOXY} = {$PrivoxyEnabled}", 33);
    if ($PrivoxyEnabled == 1) {
        build_progress_wb("{compiling} {APP_PRIVOXY}", 40);
        shell_exec("/etc/init.d/privoxy restart");
        build_progress_wb("{compiling} {APP_PRIVOXY} {done}", 45);
    }
    build_progress_wb("{reloading}", 50);
    system("/etc/init.d/squid reload --script=" . basename(__FILE__));
    $sock = new sockets();
    $EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
    $PrivoxyEnabled = intval($sock->GET_INFO("PrivoxyEnabled"));
    if ($EnableTransparent27 == 1) {
        build_progress_wb("{reloading} NAT", 60);
        system("/etc/init.d/squid-nat reload --script=" . basename(__FILE__));
    }
    build_progress_wb("{success}", 100);
}