Beispiel #1
0
function save_settings()
{
    $sock = new sockets();
    if (isset($_GET["EnableClamavInCiCap"])) {
        $ci = new cicap();
        if ($ci->EnableClamavInCiCap != $_GET["EnableClamavInCiCap"]) {
            $sock->SET_INFO("EnableClamavInCiCap", $_GET["EnableClamavInCiCap"]);
            $reconfigure_squid = true;
            $sock->getFrameWork("cmd.php?squid-reconfigure=yes");
        }
    }
    if (isset($_GET["EnableSquidGuardInCiCAP"])) {
        if ($sock->GET_INFO("EnableSquidGuardInCiCAP") != $_GET["EnableSquidGuardInCiCAP"]) {
            $sock->SET_INFO("EnableSquidGuardInCiCAP", $_GET["EnableSquidGuardInCiCAP"]);
            $reconfigure_squid = true;
        }
    }
    if (isset($_GET["CICAPListenAddress"])) {
        if ($sock->GET_INFO("CICAPListenAddress") != $_GET["CICAPListenAddress"]) {
            $sock->SET_INFO("CICAPListenAddress", $_GET["CICAPListenAddress"]);
            writelogs("CICAPListenAddress -> `{$_GET["CICAPListenAddress"]}`", __FUNCTION__, __FILE__, __LINE__);
            $reconfigure_squid = true;
        }
    }
    if ($reconfigure_squid) {
        $sock->getFrameWork("cmd.php?squid-reconfigure=yes");
    }
    $ci = new cicap();
    while (list($num, $line) = each($_GET)) {
        if (preg_match('#^srv_clamav_(.+)#', $num, $re)) {
            $num = "srv_clamav.{$re[1]}";
        }
        writelogs("Save {$num} => {$line}", __FUNCTION__, __FILE__, __LINE__);
        $ci->main_array["CONF"][$num] = $line;
    }
    $tpl = new templates();
    $ci->Save();
    $sock->getFrameWork("cmd.php?clamd-restart=yes");
    NotifyServers();
}
Beispiel #2
0
function save_settings(){
	$sock=new sockets();
	if(isset($_GET["EnableClamavInCiCap"])){
		$ci=new cicap();
		if($ci->EnableClamavInCiCap<>$_GET["EnableClamavInCiCap"]){
			$sock->SET_INFO("EnableClamavInCiCap",$_GET["EnableClamavInCiCap"]);
			$sock->getFrameWork("cmd.php?squid-reconfigure=yes");
		}
	}
	if(isset($_GET["EnableSquidGuardInCiCAP"])){
		if($sock->GET_INFO("EnableSquidGuardInCiCAP")<>$_GET["EnableSquidGuardInCiCAP"]){
				$sock->SET_INFO("EnableSquidGuardInCiCAP",$_GET["EnableSquidGuardInCiCAP"]);
				$sock->getFrameWork("cmd.php?squid-reconfigure=yes");
		}
	}
	
	
	$ci=new cicap();
	while (list ($num, $line) = each ($_GET)){	
		if(preg_match('#^srv_clamav_(.+)#',$num,$re)){
			$num="srv_clamav.{$re[1]}";
		}
		
		writelogs("Save $num => $line",__FUNCTION__,__FILE__,__LINE__);
		$ci->main_array["CONF"][$num]=$line;
	}
	
	$tpl=new templates();
	$ci->Save();
	
}
function save_settings_post()
{
    $sock = new sockets();
    if (isset($_POST["CicapEnabled"])) {
        $sock->SET_INFO("EnableClamavInCiCap", $_POST["CicapEnabled"]);
        $sock->SET_INFO("CicapEnabled", $_POST["CicapEnabled"]);
        writelogs("EnableClamavInCiCap -> `{$_POST["EnableClamavInCiCap"]}`", __FUNCTION__, __FILE__, __LINE__);
        $sock->getFrameWork("cmd.php?squid-reconfigure=yes");
        $sock->getFrameWork("services.php?restart-artica-status=yes");
    }
    $ci = new cicap();
    while (list($num, $line) = each($_POST)) {
        if (preg_match('#^srv_clamav_(.+)#', $num, $re)) {
            $num = "srv_clamav.{$re[1]}";
        }
        writelogs("Save {$num} => {$line}", __FUNCTION__, __FILE__, __LINE__);
        $ci->main_array["CONF"][$num] = $line;
    }
    $tpl = new templates();
    $ci->Save();
    NotifyServers();
}
Beispiel #4
0
function save_settings()
{
    $ci = new cicap();
    while (list($num, $line) = each($_GET)) {
        if (preg_match('#^srv_clamav_(.+)#', $num, $re)) {
            $num = "srv.clamav.{$re[1]}";
        }
        $ci->main_array["CONF"][$num] = $line;
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
    $ci->Save();
}