Пример #1
0
function conf()
{
    $sock = new sockets();
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    if ($EnableRemoteStatisticsAppliance == 1) {
        return;
    }
    $users = new usersMenus();
    $sock = new sockets();
    $unix = new unix();
    @mkdir("/var/tmp", 0775, true);
    if (!is_file("/var/log/ufdbguard/ufdbguardd.log")) {
        @mkdir("/var/log/ufdbguard", 0755, true);
        @file_put_contents("/var/log/ufdbguard/ufdbguardd.log", "see /var/log/squid/ufdbguardd.log\n");
        shell_exec("chmod 777 /var/log/ufdbguard/ufdbguardd.log");
    }
    if (is_file("/usr/sbin/ufdbguardd")) {
        if (!is_file("/usr/bin/ufdbguardd")) {
            $unix = new unix();
            $ln = $unix->find_program("ln");
            shell_exec("{$ln} -s /usr/sbin/ufdbguardd /usr/bin/ufdbguardd");
        }
    }
    @mkdir("/etc/ufdbguard", 0755, true);
    build_ufdbguard_config();
    buildDans();
    ufdbguard_schedule();
    if ($users->APP_UFDBGUARD_INSTALLED) {
        $chmod = $unix->find_program("chmod");
        shell_exec("{$chmod} 755 /etc >/dev/null 2>&1");
        shell_exec("{$chmod} 755 /etc/ufdbguard >/dev/null 2>&1");
        shell_exec("{$chmod} 755 /var/log/ufdbguard >/dev/null 2>&1");
        shell_exec("{$chmod} 755 /var/log/squid >/dev/null 2>&1");
        shell_exec("{$chmod} -R 755 /var/lib/squidguard >/dev/null 2>&1 &");
        ufdbguard_admin_events("Asking to reload ufdbguard", __FUNCTION__, __FILE__, __LINE__, "ufdbguard-service");
        build_ufdbguard_HUP();
    }
}
Пример #2
0
     $GLOBALS["debug"] = true;
     ini_set_verbosed();
 }
 if (preg_match("#--reload#", $imploded)) {
     $GLOBALS["RELOAD"] = true;
 }
 if (preg_match("#--shalla#", $imploded)) {
     $GLOBALS["SHALLA"] = true;
 }
 if (preg_match("#--catto=(.+?)\\s+#", $imploded, $re)) {
     $GLOBALS["CATTO"] = $re[1];
 }
 $argvs = $argv;
 unset($argvs[0]);
 if ($argv[1] == "--dansguardian") {
     buildDans();
     exit;
 }
 if ($argv[1] == "--databases-status") {
     databases_status();
     exit;
 }
 if ($argv[1] == "--ufdbguard-status") {
     print_r(UFDBGUARD_STATUS());
     exit;
 }
 if ($argv[1] == "--cron-compile") {
     cron_compile();
     exit;
 }
 if ($argv[1] == "--compile-category") {