Ejemplo n.º 1
0
function xstart()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    build_progress("{starting} {ssl_rules}", 15);
    if (!checkIntegrated()) {
        build_progress("{starting} {ssl_rules}", 30);
        $squid_ssl = new squid_ssl();
        $squid_ssl->build();
        build_progress("{starting} {reconfigure_proxy_service}", 50);
        system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
        if (!checkIntegrated()) {
            build_progress("{failed}", 110);
            return;
        }
        build_progress("{done} {ssl_rules}", 100);
        return;
    }
    build_progress("{starting} {ssl_rules}", 30);
    $squid_ssl = new squid_ssl();
    $squid_ssl->build();
    if (!Test_config()) {
        build_progress("{failed}", 90);
        @file_put_contents("/etc/squid3/GlobalAccessManager_auth.conf", "\n");
        @file_put_contents("/etc/squid3/GlobalAccessManager_url_rewrite.conf", "\n");
        @file_put_contents("/etc/squid3/GlobalAccessManager_deny_cache.conf", "\n");
        @file_put_contents("/etc/squid3/icap.conf", "\n");
        build_progress("{failed}", 110);
        return;
    }
    build_progress("{done} {reloading_proxy_service}", 100);
    $squidbin = $unix->find_program("squid");
    system("{$squidbin} -f /etc/squid3/squid.conf -k reconfigure");
}
Ejemplo n.º 2
0
function xstart()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 15);
    $extern = new external_acls_squid();
    $extern->Build();
    if (!checkIntegrated()) {
        build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 30);
        $squid_access_manager = new squid_access_manager();
        $squid_access_manager->build_all();
        build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 40);
        $squid = new squidbee();
        $icap = new icap();
        $icap->build_services();
        build_progress("{starting} {reconfigure_proxy_service}", 50);
        system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
        if (!checkIntegrated()) {
            build_progress("Missing CONF files:{failed}", 110);
            return;
        }
        build_progress("{done} {GLOBAL_ACCESS_CENTER}", 100);
        return;
    }
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 20);
    $external_acls_squid = new external_acls_squid();
    $external_acls_squid->Build();
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 30);
    $GLOBALS["aclGen"] = new squid_acls();
    $GLOBALS["aclGen"]->Build_Acls(true);
    $ACLS_TO_ADD = @implode("\n", $GLOBALS["aclGen"]->acls_array);
    @file_put_contents("/etc/squid3/acls_center.conf", $ACLS_TO_ADD);
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 50);
    $squid_access_manager = new squid_access_manager();
    $squid_access_manager->build_all();
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 55);
    $squid_childs = new squid_childs();
    $squid_childs->build();
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 60);
    $squid = new squidbee();
    $q = new squid_freewebs();
    $icap = new icap();
    $icap->build_services();
    build_progress("{starting} {GLOBAL_ACCESS_CENTER}", 60);
    if ($GLOBALS["NOCHECK"]) {
        return true;
    }
    if (!Test_config()) {
        build_progress("{failed}", 90);
        @file_put_contents("/etc/squid3/GlobalAccessManager_auth.conf", "\n");
        @file_put_contents("/etc/squid3/GlobalAccessManager_url_rewrite.conf", "\n");
        @file_put_contents("/etc/squid3/GlobalAccessManager_deny_cache.conf", "\n");
        @file_put_contents("/etc/squid3/icap.conf", "\n");
        build_progress("{failed}", 110);
        return;
    }
    build_progress("{done} {reloading_proxy_service}", 100);
    $squidbin = $unix->find_program("squid");
    system("{$squidbin} -f /etc/squid3/squid.conf -k reconfigure");
}