Пример #1
0
function ApplyConfigDansGuardian($noecho = 0)
{
    $user = new usersMenus();
    if (!isset($_GET["hostname"])) {
        $hostname = $user->hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $prod = "dansguardian_main_settings";
    $tpl = new templates();
    if ($user->DANSGUARDIAN_INSTALLED == false) {
        echo $tpl->_ENGINE_parse_body(NotInstalled($prod));
        exit;
    }
    include_once 'ressources/class.dansguardian.inc';
    $dans = new dansguardian($hostname);
    $dans->SaveSettings();
    if (is_array($dans->Master_rules_index)) {
        while (list($num, $line) = each($dans->Master_rules_index)) {
            $rules = new dansguardian_rules($hostname, $num);
            $rules->SaveConfigFiles();
        }
    }
    $sock = new sockets();
    $sock->getfile('dansguardian_saveconf:' . $hostname);
    if ($noecho == 0) {
        echo $tpl->_ENGINE_parse_body(Success($prod));
    }
}
Пример #2
0
function template_options_save()
{
    $dans = new dansguardian();
    $dans->DansGuardianEnableUserArticaIP = $_GET["DansGuardianEnableUserArticaIP"];
    $dans->SaveSettings();
}
Пример #3
0
function main_network_edit_port_dans(){
	$users=new usersMenus();
	if($_GET["hostname"]==null){$hostname=$users->hostname;}else{$hostname=$_GET["hostname"];}	
	
	$squid=new squid($_GET["hostname"]);
	$squid->http_port_array[0]=$_GET["squid_http_port"];
	$squid->SaveToLdap();	
	writelogs("->class.dansguardian.inc -> dansguardian listen port={$_GET["dans_http_port"]}",__FUNCTION__,__FILE__);
	$dans=new dansguardian($_GET["hostname"]);
	$dans->Master_array["filterip"]=$_GET["dans_http_port_ip"];
	$dans->Master_array["filterport"]=$_GET["dans_http_port"];
	$dans->SaveSettings();
	}
    CleanDB();
    echo "\n";
    die;
}
//exec.dansguardian.compile.php --patterns
echo "\n";
echo "Starting......: Dansguardian reconfigure settings\n";
$q = new mysql();
if (!$q->test_mysql_connection()) {
    echo "Starting......: Dansguardian Mysql error\n";
    die;
}
$q->CheckTable_dansguardian();
LoadGlobal_exceptionsitelist();
$dans = new dansguardian();
$dans->SaveSettings();
$cmd = LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.web-community-filter.php --patterns{$GLOBALS["cmdlineadd"]}";
events("MAIN:: {$cmd}");
system($cmd);
HtmlTemplate();
BuildPersonalCategories();
bannedsitelist_userdefined();
weightedphraselist_userdefined();
BuildRules();
BuildWhiteIpList();
BuildBannedIPList();
FixMissingGroupsFiles();
FixMissingFiles();
BuildMasterRule();
echo "Starting......: Dansguardian reconfigure settings done\n";
function HtmlTemplate()
Пример #5
0
function plugins_save()
{
    $squid = new squidbee();
    $multiple = false;
    $users = new usersMenus();
    if (preg_match('#^([0-9]+)\\.([0-9]+)#', $users->SQUID_VERSION, $re)) {
        if ($re[1] >= 3) {
            if ($re[2] >= 1) {
                $multiple = true;
            }
        }
    }
    $tpl = new templates();
    if (isset($_GET["enable_kavproxy"])) {
        if (!$multiple) {
            if ($_GET["enable_c_icap"] == 1) {
                echo $tpl->javascript_parse_text("{DISABLE_KAV_ENABLE_CICAP}");
                $_GET["enable_kavproxy"] = 0;
            }
        }
        $squid->enable_kavproxy = $_GET["enable_kavproxy"];
    }
    writelogs("Save kavProxy {$_GET["enable_kavproxy"]}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
    if (isset($_GET["enable_c_icap"])) {
        writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
        $squid->enable_cicap = $_GET["enable_c_icap"];
    }
    if (isset($_GET["enable_squidguard"])) {
        writelogs("Save enable_squidguard {$_GET["enable_squidguard"]}", __FUNCTION__, __FILE__);
        $squid->enable_squidguard = $_GET["enable_squidguard"];
        if ($_GET["enable_squidguard"] == 1) {
            $_GET["enable_dansguardian"] = 0;
        }
    }
    if (isset($_GET["enable_dansguardian"])) {
        writelogs("Save dansguardian {$_GET["enable_dansguardian"]}", __FUNCTION__, __FILE__);
        $squid->enable_dansguardian = $_GET["enable_dansguardian"];
        include_once dirname(__FILE__) . '/ressources/class.dansguardian.inc';
        $dans = new dansguardian();
        $dans->SaveSettings();
    }
    if (!$squid->SaveToLdap()) {
        if (trim($squid->ldap_error) != null) {
            echo $squid->ldap_error;
        }
        return;
    }
    writelogs("Save kavProxy:Final {$squid->enable_kavproxy}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap:Final {$squid->enable_cicap}", __FUNCTION__, __FILE__);
    if ($squid->enable_kavproxy == 1) {
        echo $tpl->javascript_parse_text("{KAVPROXY_WILLBEENABLED}");
    }
    if ($squid->enable_cicap == 1) {
        echo $tpl->javascript_parse_text("{CICAP_WILLBEENABLED}");
    }
}
Пример #6
0
function plugins_save()
{
    $squid = new squidbee();
    $sock = new sockets();
    $tpl = new templates();
    $multiple = false;
    $users = new usersMenus();
    if (preg_match('#^([0-9]+)\\.([0-9]+)#', $users->SQUID_VERSION, $re)) {
        if ($re[1] >= 3) {
            if ($re[2] >= 1) {
                $multiple = true;
            }
        }
    }
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    if ($users->WEBSTATS_APPLIANCE) {
        $EnableWebProxyStatsAppliance = 1;
    }
    $tpl = new templates();
    if (isset($_GET["enable_kavproxy"])) {
        if (!$multiple) {
            if ($_GET["enable_c_icap"] == 1) {
                echo $tpl->javascript_parse_text("{DISABLE_KAV_ENABLE_CICAP}");
                $_GET["enable_kavproxy"] = 0;
            }
        }
        $squid->enable_kavproxy = $_GET["enable_kavproxy"];
    }
    if (isset($_GET["enable_dansguardian"])) {
        if ($_GET["enable_dansguardian"] == 1) {
            if ($_GET["enable_ufdbguardd"] == 1) {
                echo $tpl->javascript_parse_text("{disable_ufdbguardd_dansguardian_enabled}\n");
            }
            $_GET["enable_ufdbguardd"] = 0;
        }
    }
    writelogs("Save kavProxy {$_GET["enable_kavproxy"]}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
    writelogs("Save ufdbguard {$_GET["enable_ufdbguardd"]}", __FUNCTION__, __FILE__);
    writelogs("Save adzapper {$_GET["enable_adzapper"]}", __FUNCTION__, __FILE__);
    if (isset($_GET["enable_c_icap"])) {
        writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
        $squid->enable_cicap = $_GET["enable_c_icap"];
    }
    //---------------------------------------------------------------------------------------------------------------------------------------
    if (isset($_GET["enable_ufdbguardd"])) {
        if ($EnableWebProxyStatsAppliance == 1) {
            $datas = unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
        }
        if ($_GET["enable_ufdbguardd"] == 0) {
            $datas["UseRemoteUfdbguardService"] = 0;
        }
        if ($_GET["enable_ufdbguardd"] == 1) {
            $_GET["enable_squidguard"] = 0;
            $datas["UseRemoteUfdbguardService"] = 1;
            $sock->getFrameWork("cmd.php?reload-squidguard=yes");
        }
        if ($EnableWebProxyStatsAppliance == 1) {
            $datas["remote_port"] = $datas["listen_port"];
            if (!is_numeric($datas["remote_port"])) {
                $datas["remote_port"] = 3977;
            }
            while (list($key, $line) = each($_POST)) {
                writelogs("SAVE {$key} = {$line}", __FUNCTION__, __FILE__, __LINE__);
                $datas[$key] = $line;
            }
            $sock->SaveConfigFile(base64_encode(serialize($datas)), "ufdbguardConfig");
            $sock->getFrameWork("squid.php?notify-remote-proxy=yes");
        }
        $sock->SET_INFO("EnableUfdbGuard", $_GET["enable_ufdbguardd"]);
    }
    //---------------------------------------------------------------------------------------------------------------------------------------
    if (isset($_GET["enable_adzapper"])) {
        writelogs("Save enable_adzapper {$_GET["enable_adzapper"]}", __FUNCTION__, __FILE__);
        $squid->enable_adzapper = $_GET["enable_adzapper"];
    }
    if (isset($_GET["enable_squidguard"])) {
        writelogs("Save enable_squidguard {$_GET["enable_squidguard"]}", __FUNCTION__, __FILE__);
        $squid->enable_squidguard = $_GET["enable_squidguard"];
        if ($_GET["enable_squidguard"] == 1) {
            $_GET["enable_dansguardian"] = 0;
        }
    }
    if (isset($_GET["enable_squidclamav"])) {
        writelogs("Save enable_squidclamav {$_GET["enable_squidclamav"]}", __FUNCTION__, __FILE__);
        $squid->enable_squidclamav = $_GET["enable_squidclamav"];
        if ($_GET["enable_squidclamav"] == 1) {
            $squid->enable_cicap = 0;
        }
    }
    if (isset($_GET["enable_metascanner"])) {
        writelogs("Save enable_metascanner {$_GET["enable_metascanner"]}", __FUNCTION__, __FILE__);
        $squid->enable_metascanner = $_GET["enable_metascanner"];
        if ($_GET["enable_metascanner"] == 1) {
            $squid->enable_cicap = 1;
        }
    }
    if (isset($_GET["enable_ecapav"])) {
        writelogs("Save enable_ecapav {$_GET["enable_ecapav"]}", __FUNCTION__, __FILE__);
        $squid->enable_ecapav = $_GET["enable_ecapav"];
    }
    if (isset($_GET["enable_dansguardian"])) {
        writelogs("Save dansguardian {$_GET["enable_dansguardian"]}", __FUNCTION__, __FILE__);
        $squid->enable_dansguardian = $_GET["enable_dansguardian"];
        include_once dirname(__FILE__) . '/ressources/class.dansguardian.inc';
        $dans = new dansguardian();
        $dans->SaveSettings();
    }
    if (!$squid->SaveToLdap()) {
        if (trim($squid->ldap_error) != null) {
            echo $squid->ldap_error;
        }
        return;
        NotifyServers();
    }
    writelogs("Save kavProxy:Final {$squid->enable_kavproxy}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap:Final {$squid->enable_cicap}", __FUNCTION__, __FILE__);
    if ($squid->enable_kavproxy == 1) {
        echo $tpl->javascript_parse_text("{KAVPROXY_WILLBEENABLED}");
        $sock->getFrameWork("squid.php?kav4proxy-configure=yes");
    }
    if ($squid->enable_cicap == 1) {
        echo $tpl->javascript_parse_text("{CICAP_WILLBEENABLED}");
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?restart-artica-status=yes");
}
Пример #7
0
function plugins_save()
{
    $squid = new squidbee();
    $sock = new sockets();
    $tpl = new templates();
    $multiple = false;
    $users = new usersMenus();
    if (preg_match('#^([0-9]+)\\.([0-9]+)#', $users->SQUID_VERSION, $re)) {
        if ($re[1] >= 3) {
            if ($re[2] >= 1) {
                $multiple = true;
            }
        }
    }
    $tpl = new templates();
    if (isset($_GET["enable_kavproxy"])) {
        if (!$multiple) {
            if ($_GET["enable_c_icap"] == 1) {
                echo $tpl->javascript_parse_text("{DISABLE_KAV_ENABLE_CICAP}");
                $_GET["enable_kavproxy"] = 0;
            }
        }
        $squid->enable_kavproxy = $_GET["enable_kavproxy"];
    }
    if (isset($_GET["enable_dansguardian"])) {
        if ($_GET["enable_dansguardian"] == 1) {
            if ($_GET["enable_ufdbguardd"] == 1) {
                echo $tpl->javascript_parse_text("{disable_ufdbguardd_dansguardian_enabled}\n");
            }
            $_GET["enable_ufdbguardd"] = 0;
        }
    }
    writelogs("Save kavProxy {$_GET["enable_kavproxy"]}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
    writelogs("Save ufdbguard {$_GET["enable_ufdbguardd"]}", __FUNCTION__, __FILE__);
    writelogs("Save adzapper {$_GET["enable_adzapper"]}", __FUNCTION__, __FILE__);
    if (isset($_GET["enable_c_icap"])) {
        writelogs("Save c-icap {$_GET["enable_c_icap"]}", __FUNCTION__, __FILE__);
        $squid->enable_cicap = $_GET["enable_c_icap"];
    }
    if (isset($_GET["enable_ufdbguardd"])) {
        writelogs("Save enable_ufdbguardd {$_GET["enable_ufdbguardd"]}", __FUNCTION__, __FILE__);
        if ($_GET["enable_ufdbguardd"] == 1) {
            $_GET["enable_squidguard"] = 0;
            $sock->getFrameWork("cmd.php?reload-squidguard=yes");
        }
        $squid->enable_UfdbGuard = $_GET["enable_ufdbguardd"];
    }
    if (isset($_GET["enable_adzapper"])) {
        writelogs("Save enable_adzapper {$_GET["enable_adzapper"]}", __FUNCTION__, __FILE__);
        $squid->enable_adzapper = $_GET["enable_adzapper"];
    }
    if (isset($_GET["enable_squidguard"])) {
        writelogs("Save enable_squidguard {$_GET["enable_squidguard"]}", __FUNCTION__, __FILE__);
        $squid->enable_squidguard = $_GET["enable_squidguard"];
        if ($_GET["enable_squidguard"] == 1) {
            $_GET["enable_dansguardian"] = 0;
        }
    }
    if (isset($_GET["enable_squidclamav"])) {
        writelogs("Save enable_squidclamav {$_GET["enable_squidclamav"]}", __FUNCTION__, __FILE__);
        $squid->enable_squidclamav = $_GET["enable_squidclamav"];
        if ($_GET["enable_squidclamav"] == 1) {
            $squid->enable_cicap = 0;
        }
    }
    if (isset($_GET["enable_dansguardian"])) {
        writelogs("Save dansguardian {$_GET["enable_dansguardian"]}", __FUNCTION__, __FILE__);
        $squid->enable_dansguardian = $_GET["enable_dansguardian"];
        include_once dirname(__FILE__) . '/ressources/class.dansguardian.inc';
        $dans = new dansguardian();
        $dans->SaveSettings();
    }
    if (!$squid->SaveToLdap()) {
        if (trim($squid->ldap_error) != null) {
            echo $squid->ldap_error;
        }
        return;
    }
    writelogs("Save kavProxy:Final {$squid->enable_kavproxy}", __FUNCTION__, __FILE__);
    writelogs("Save c-icap:Final {$squid->enable_cicap}", __FUNCTION__, __FILE__);
    if ($squid->enable_kavproxy == 1) {
        echo $tpl->javascript_parse_text("{KAVPROXY_WILLBEENABLED}");
        $sock->getFrameWork("squid.php?kav4proxy-configure=yes");
    }
    if ($squid->enable_cicap == 1) {
        echo $tpl->javascript_parse_text("{CICAP_WILLBEENABLED}");
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?restart-artica-status=yes");
}