Exemple #1
0
function change_value($key,$val){
	$squid=new squidbee();
	$squid->global_conf_array[$key]=$val;
	$squid->SaveToLdap();
	echo "Starting......: Squid change $key to $val (squid will be restarted)\n";
	
}
function sizelimit_save()
{
    $squid = new squidbee();
    $squid->global_conf_array["request_header_max_size"] = $_GET["request_header_max_size"];
    $squid->global_conf_array["request_body_max_size"] = $_GET["request_body_max_size"];
    $squid->global_conf_array["reply_body_max_size"] = $_GET["reply_body_max_size"];
    $squid->SaveToLdap();
}
Exemple #3
0
function Save()
{
    $squid = new squidbee();
    $sock = new sockets();
    $sock->SET_INFO("SquidMemoryPoolsLimit", $_POST["SquidMemoryPoolsLimit"]);
    $sock->SET_INFO("SquidMemoryPoolsLimit", $_POST["SquidMemoryPoolsLimit"]);
    if (is_numeric($_POST["cache_mem"])) {
        $squid->global_conf_array["cache_mem"] = trim($_POST["cache_mem"]) . " MB";
    }
    $squid->SaveToLdap(true);
}
function max_filedesc()
{
    $squid = new squidbee();
    if ($_POST["max_filedesc"] < 1024) {
        $_POST["max_filedesc"] = 1024;
    }
    $squid->max_filedesc = $_POST["max_filedesc"];
    $squid->SaveToLdap();
    $sock = new sockets();
    $key = base64_encode("fs.file-max");
    $sock->getFrameWork("cmd.php?sysctl-setvalue={$_POST["fs_filemax"]}&key={$key}");
}
function save()
{
    $sock = new sockets();
    $sock->SET_INFO("CacheReplacementPolicy", $_POST["CacheReplacementPolicy"]);
    $sock->SET_INFO("SquidDebugCacheProc", $_POST["SquidDebugCacheProc"]);
    $sock->SET_INFO("ForceWindowsUpdateCaching", $_POST["ForceWindowsUpdateCaching"]);
    $sock->SET_INFO("ProxyDedicateMicrosoftRules", $_POST["ProxyDedicateMicrosoftRules"]);
    $squid = new squidbee();
    $squid->global_conf_array["maximum_object_size"] = $_POST["maximum_object_size"] . " MB";
    $squid->SaveToLdap(true);
    $tpl = new templates();
    echo $tpl->javascript_parse_text("{must_restart_proxy_settings}");
}
Exemple #6
0
function save()
{
    $sock = new sockets();
    if ($_POST["SquidBinIpaddr"] == null) {
        $_POST["SquidBinIpaddr"] = "0.0.0.0";
    }
    $sock->SET_INFO("SquidBinIpaddr", $_POST["SquidBinIpaddr"]);
    if (isset($_POST["tcp_outgoing_address"])) {
        $squid = new squidbee();
        $squid->global_conf_array["tcp_outgoing_address"] = $_POST["tcp_outgoing_address"];
        $squid->SaveToLdap(true);
    }
}
function xfiledesc()
{
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $unix = new unix();
    $pid = @file_get_contents($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        squid_admin_mysql(0, "Cannot change file descriptors (PID {$pid} already executed)", null, __FILE__, __LINE__);
        die;
    }
    @file_put_contents($pidfile, getmypid());
    $TimePid = $unix->file_time_min($pidTime);
    if ($TimePid < 5) {
        squid_admin_mysql(0, "Cannot change file descriptors ( require 5mn, current {$TimePid}mn)", null, __FILE__, __LINE__);
        die;
    }
    @unlink($pidTime);
    @file_put_contents($pidTime, time());
    $squid = new squidbee();
    $sock = new sockets();
    $sysctl = $unix->find_program("sysctl");
    $t = time();
    if (!is_numeric($squid->max_filedesc)) {
        $squid->max_filedesc = 8192;
    }
    exec("{$sysctl} -n fs.file-max", $results);
    $file_max = intval(trim(@implode("", $results)));
    $file_max_org = $file_max;
    $max_filedesc = intval($squid->max_filedesc);
    if ($max_filedesc == 0) {
        $max_filedesc = 8192;
    }
    $new_max_filedesc = $max_filedesc + 1000;
    echo "Current System: {$file_max}, Proxy {$max_filedesc}\n";
    if ($new_max_filedesc > $file_max - 100) {
        $file_max = $file_max + 1000;
        shell_exec("{$sysctl} -w fs.file-max={$file_max}");
        $unix->sysctl("fs.file-max", $file_max);
    }
    $squid->max_filedesc = $new_max_filedesc;
    $squid->SaveToLdap(true);
    $php = $unix->LOCATE_PHP5_BIN();
    shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    squid_admin_mysql(0, "Restarting Proxy service to increase file descriptors from {$max_filedesc}/{$file_max_org} to {$new_max_filedesc}/{$file_max}", null, __FILE__, __LINE__);
    shell_exec("/etc/init.d/squid restart --force");
}
Exemple #8
0
function time_save(){
	$tpl=new templates();
	if($_GET["time_day"]==null){echo $tpl->_ENGINE_parse_body("{day}: Wrong!\n");exit;}
	$squid=new squidbee();
	$squid->acl_times["time:{$_GET["gpid"]}:{$_GET["ou"]}"][$_GET["time_day"]]="{$_GET["time_hour"]}:{$_GET["time_min"]}-{$_GET["end_time_hour"]}:{$_GET["end_time_min"]}";
	$squid->SaveToLdap();
	echo $tpl->_ENGINE_parse_body("{$_GET["time_hour"]}:{$_GET["time_min"]}-{$_GET["end_time_hour"]}:{$_GET["end_time_min"]}:{success}\n");
	
}
Exemple #9
0
function listen_port_save()
{
    $squid = new squidbee();
    $squid->listen_port = $_GET["listenport"];
    if (!$squid->SaveToLdap()) {
        echo $squid->ldap_error;
        exit;
    } else {
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body('Port:{success}');
    }
}
function SQUID_DELETE_CACHE($value)
{
    $value = unserialize(base64_decode($value));
    if (!is_array($value)) {
        send_email_events("Failed to add/modify squid cache (not an array)", null, "CLOUD");
        return true;
    }
    include_once dirname(__FILE__) . '/ressources/class.squid.inc';
    $sock = new sockets();
    $squid = new squidbee();
    unset($squid->cache_list[$value["cache_directory"]]);
    $squid->SaveToLdap();
    $squid->SaveToServer();
    $sock = new sockets();
    $SquidCacheTasks = unserialize(base64_decode($sock->GET_INFO("SquidCacheTask")));
    $SquidCacheTasks[$value["cache_directory"]] = $_GET;
    $sock->SaveConfigFile(base64_encode(serialize($SquidCacheTasks)), "SquidCacheTask");
    $sock->getFrameWork("cmd.php?squid-build-caches=yes");
    send_email_events("Success removing squid cache \"{$value["cache_directory"]}\"", "Squid was scheduled to be reloaded.\n", "CLOUD");
    return true;
}
Exemple #11
0
function enable_ftp_restrictions()
{
    $s = new squidbee();
    $s->enable_ftp_restrictions = $_GET["enable_ftp_restrictions"];
    $s->SaveToLdap();
}
Exemple #12
0
function main_rules_apply_conf()
{
    if ($_GET["hostname"] == null) {
        $users = new usersMenus();
        $_GET["hostname"] = $users->hostname;
    }
    $dans = new dansguardian($_GET["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();
        }
    }
    $squid = new squidbee();
    $squid->SaveToLdap();
    $squid->SaveToServer();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body(applysettings("dansguardian", "ApplyDansGuardianSettings('{$_GET["hostname"]}')"));
}
Exemple #13
0
function enable_snmp(){
	$squid=new squidbee();
	$squid->snmp_enable=$_POST["enable_snmp"];
	$squid->snmp_community=$_POST["snmp_community"];
	$squid->snmp_port=$_POST["snmp_port"];
	$squid->snmp_access_ip=$_POST["snmp_access_ip"];
	$squid->SaveToLdap();
	
}
Exemple #14
0
function WCCP_SAVE()
{
    $squid = new squidbee();
    $squid->wccp2_enabled = $_GET["wccp2_enabled"];
    $squid->wccp2_router = $_GET["wccp2_router"];
    $squid->wccp2_forwarding_method = $_GET["wccp2_forwarding_method"];
    $squid->wccp2_return_method = $_GET["wccp2_return_method"];
    $squid->wccp2_assignment_method = $_GET["wccp2_assignment_method"];
    $squid->SaveToLdap();
}
function visible_hostname_save()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $squid = new squidbee();
    $hostid = $_POST["hostid"];
    $nodeid = $_POST["nodeid"];
    $visible_hostname = $_POST["visible_hostname"];
    $squid->nodes_names[$hostid] = $visible_hostname;
    $squid->SaveToLdap(true);
    $q = new blackboxes($hostid);
    $q->reconfigure_squid();
}
Exemple #16
0
function proxy_behavior_save()
{
    $squid = new squidbee();
    $sock = new sockets();
    $exclusive_reverse_proxy = $_POST["exclusive_reverse_proxy"];
    $exclusive_internet_proxy = $_POST["exclusive_internet_proxy"];
    $mixed_mode = $_POST["mixed_mode"];
    if ($exclusive_reverse_proxy == 1) {
        $sock->SET_INFO("SquidActHasReverse", 1);
        $sock->SET_INFO("SquidActHasReverseOnly", 1);
        $sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port);
        $sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port);
        $sock->SET_INFO("SquidOldSSLPort", $squid->ssl_port);
        $squid->listen_port = 80;
        $squid->second_listen_port = 0;
        $squid->ICP_PORT = 0;
        $squid->HTCP_PORT = 0;
        $squid->ssl_port = 443;
        if (!$squid->SaveToLdap()) {
            echo $squid->ldap_error;
            return;
        }
        return;
    }
    if ($exclusive_internet_proxy == 1) {
        $SquidOldHTTPPort = $sock->GET_INFO("SquidOldHTTPPort");
        $SquidOldSSLPort = $sock->GET_INFO("SquidOldSSLPort");
        $SquidOldHTTPPort2 = $sock->GET_INFO("SquidOldHTTPPort2");
        $sock->SET_INFO("SquidActHasReverse", 0);
        $sock->SET_INFO("SquidActHasReverseOnly", 0);
        if (is_numeric($SquidOldHTTPPort)) {
            if ($SquidOldHTTPPort > 0) {
                $squid->listen_port = $SquidOldHTTPPort;
            }
        }
        if (is_numeric($SquidOldHTTPPort2)) {
            if ($SquidOldHTTPPort2 > 0) {
                $squid->second_listen_port = $SquidOldHTTPPort2;
            }
        }
        if (is_numeric($SquidOldSSLPort)) {
            if ($SquidOldSSLPort > 0) {
                $squid->ssl_port = $SquidOldSSLPort;
            }
        }
        if (!$squid->SaveToLdap()) {
            echo $squid->ldap_error;
            return;
        }
        return;
    }
    if ($mixed_mode == 1) {
        $sock->SET_INFO("SquidActHasReverse", 1);
        if ($squid->listen_port != 80) {
            $sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port);
            $sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port);
            $squid->second_listen_port = $squid->listen_port;
            $squid->listen_port = 80;
        }
        if ($squid->ssl_port != 443) {
            $sock->SET_INFO("SquidOldSSLPort", $squid->listen_port);
            $squid->listen_port = 443;
        }
        if (!$squid->SaveToLdap()) {
            echo $squid->ldap_error;
            return;
        }
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?restart-apache-src=yes");
}
Exemple #17
0
function delete_cache()
{
    $cachedir = base64_decode($_POST["delete-cache"]);
    $squid = new squidbee();
    unset($squid->cache_list[$cachedir]);
    $sock = new sockets();
    $squid->SaveToLdap(true);
    $squid->SaveToServer(true);
    $sock->getFrameWork("squid.php?remove-cache={$_POST["delete-cache"]}");
}
function section_ports_save()
{
    $squid = new squidbee();
    $sock = new sockets();
    $squid->visible_hostname = $_POST["visible_hostname"];
    $sock = new sockets();
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    $FreeWebListenSSLPort = $sock->GET_INFO("FreeWebListenSSLPort");
    $FreeWebListen = $sock->GET_INFO("FreeWebListen");
    if (!is_numeric($FreeWebListenSSLPort)) {
        $FreeWebListenSSLPort = 443;
    }
    if (!is_numeric($FreeWebListen)) {
        $FreeWebListen = 80;
    }
    if ($_POST["listen_port"] == $FreeWebListen) {
        $sock->SET_INFO("FreeWebListen", $_GET["listenport"] + 1);
    }
    if ($_POST["ssl_port"] == $FreeWebListenSSLPort) {
        $sock->SET_INFO("FreeWebListenSSLPort", $_GET["ssl_port"] + 1);
    }
    if ($_POST["hasProxyTransparent"] == 1) {
        if ($_POST["SquidTransparentMixed"] == 1) {
            if ($_POST["second_listen_port"] == 0) {
                $_POST["second_listen_port"] = 3140;
            }
        }
    }
    $squid = new squidbee();
    $squid->hasProxyTransparent = $_POST["hasProxyTransparent"];
    $squid->listen_port = $_POST["listen_port"];
    $squid->second_listen_port = $_POST["second_listen_port"];
    $squid->ICP_PORT = $_POST["icp_port"];
    $squid->HTCP_PORT = $_POST["htcp_port"];
    $squid->ssl_port = $_POST["ssl_port"];
    $squid->certificate_center = $_POST["certificate_center"];
    $sock->SET_INFO("SQUIDEnable", $_POST["SQUIDEnable"]);
    $sock->SET_INFO("KernelSendRedirects", $_POST["KernelSendRedirects"]);
    $sock->SET_INFO("SquidTransparentMixed", $_POST["SquidTransparentMixed"]);
    $sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port);
    $sock->SET_INFO("SquidOldSSLPort", $squid->ssl_port);
    $sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port);
    if (!$squid->SaveToLdap()) {
        echo $squid->ldap_error;
        return;
    }
    $tpl = new templates();
    echo $tpl->javascript_parse_text("{listen_port}:{$_POST["listen_port"]}\n", 1);
    echo $tpl->javascript_parse_text("HTTP (2):{$_POST["second_listen_port"]}\n", 1);
    echo $tpl->javascript_parse_text("{ssl_port}:{$_POST["ssl_port"]}\n", 1);
    echo $tpl->javascript_parse_text("{icp_port}:{$_POST["icp_port"]}\n", 1);
    echo $tpl->javascript_parse_text("{htcp_port}:{$_POST["htcp_port"]}\n", 1);
    if ($EnableWebProxyStatsAppliance == 1) {
        echo $tpl->javascript_parse_text("{proxy_clients_was_notified}\n", 1);
    }
    echo $tpl->javascript_parse_text("{success}\n", 1);
    $sock->getFrameWork("squid.php.php?restart-squid=yes");
    $sock->getFrameWork("cmd.php?restart-apache-src=yes");
}
function SAVE(){
	$MonitConfig=defaults_values();
	$sock=new sockets();
	
	
	if(isset($_POST["StopMaxTTL"])){
		$squid=new squidbee();
		$squid->shutdown_lifetime=$_POST["shutdown_lifetime"];
		$squid->SaveToLdap(true);
		if($_POST["StopMaxTTL"]<$_POST["shutdown_lifetime"]){
			$_POST["StopMaxTTL"]=$_POST["shutdown_lifetime"]+1;
		}
		
	}
	
	
	if(isset($_POST["EnableFailover"])){$sock->SET_INFO("EnableFailover",$_POST["EnableFailover"]);}
	if(isset($_POST["SquidCacheReloadTTL"])){$sock->SET_INFO("SquidCacheReloadTTL",$_POST["SquidCacheReloadTTL"]);}
	
	
	
	while (list ($num, $ligne) = each ($_POST) ){
		$MonitConfig[$num]=$ligne;
		
	}
	
	$newparam=base64_encode(serialize($MonitConfig));
	$sock=new sockets();
	$sock->SaveConfigFile($newparam, "SquidWatchdogMonitConfig");
	
}
function squid_transparent_exe()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        return;
    }
    @file_put_contents($pidfile, getmypid());
    $sock = new sockets();
    $squid = new squidbee();
    $WizardProxyTransparent = unserialize($sock->GET_INFO("WizardProxyTransparent"));
    $WizardProxyTransparent = unserialize($sock->GET_INFO("WizardProxyTransparent"));
    $connected_port = intval($WizardProxyTransparent["connected_port"]);
    $transparent_port = intval($WizardProxyTransparent["transparent_port"]);
    $transparent_ssl_port = intval($WizardProxyTransparent["transparent_ssl_port"]);
    $EnableSSLBump = intval($WizardProxyTransparent["EnableSSLBump"]);
    if ($connected_port == 0) {
        build_progress("Fatal connected port unconfigured", 110);
        return;
    }
    if ($transparent_port == 0) {
        build_progress("Fatal Transparent port unconfigured", 110);
        return;
    }
    echo "Connected port........: {$connected_port}\n";
    echo "Transparent port......: {$transparent_port}\n";
    echo "Transparent SSL.......: {$EnableSSLBump}/{$transparent_ssl_port}\n";
    sleep(3);
    build_progress("{reconfigure}", 20);
    $squid = new squidbee();
    $squid->listen_port = $transparent_port;
    $squid->second_listen_port = $connected_port;
    $squid->hasProxyTransparent = 1;
    if ($EnableSSLBump == 1) {
        echo "EnableSquidSSLCRTD ----> 1\n";
        $sock->SET_INFO("EnableSquidSSLCRTD", 1);
        $squid->SSL_BUMP = 1;
        $squid->ssl_port = $transparent_ssl_port;
    }
    build_progress("{saving_parameters}", 20);
    sleep(3);
    $squid->SaveToLdap(true);
    echo "hasProxyTransparent -------> 1\n";
    $sock->SET_INFO("hasProxyTransparent", 1);
    echo "SquidTransparentMixed -----> 1\n";
    $sock->SET_INFO("SquidTransparentMixed", 1);
    build_progress("{building_settings}", 30);
    $php = $unix->LOCATE_PHP5_BIN();
    system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    build_progress("{restarting_service}", 50);
    system("{$php} /usr/share/artica-postfix/exec.squid.watchdog.php --restart --force");
    build_progress("{apply_firewall_rules}", 90);
    system("{$php} /usr/share/artica-postfix/exec.squid.transparent.php --force");
    build_progress("{done}", 100);
}
Exemple #21
0
function ApplyConfigSquid()
{
    $user = new usersMenus();
    if (!isset($_GET["hostname"])) {
        $hostname = $user->hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $tpl = new templates();
    $prod = "squid_main_settings";
    $users = new usersMenus();
    if ($user->SQUID_INSTALLED == false) {
        echo $tpl->_ENGINE_parse_body(NotInstalled('squid'));
        exit;
    }
    include_once "ressources/class.squid.inc";
    $squid = new squidbee();
    $squid->SaveToLdap();
    $squid->SaveToServer();
    echo $tpl->_ENGINE_parse_body(Success($prod));
}
Exemple #22
0
function url_rewrite_bypass_save()
{
    if (!class_exists("compile_ufdbguard")) {
        include_once "ressources/class.compile.ufdbguard.inc";
    }
    $squid = new squidbee();
    $squid->url_rewrite_bypass = $_POST["url_rewrite_bypass"];
    $squid->SaveToLdap();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
    $ufdbclass = new compile_ufdbguard();
    $datas = $ufdbclass->SetDefaultsConfig($datas);
    $sock->SET_INFO("UfdbReloadBySchedule", $_POST["UfdbReloadBySchedule"]);
    $datas["url-lookup-result-during-database-reload"] = $_POST["reload"];
    $datas["url-lookup-result-when-fatal-error"] = $_POST["error"];
    $sock->SaveConfigFile(base64_encode(serialize($datas)), "ufdbguardConfig");
}
function parameters_save()
{
    $sock = new sockets();
    $sock->SET_INFO("EnableNginx", $_POST["EnableNginx"]);
    $sock->SET_INFO("SquidReverseDefaultWebSite", $_POST["SquidReverseDefaultWebSite"]);
    $sock->SET_INFO("EnableFreeWeb", $_POST["EnableFreeWeb"]);
    $sock->SET_INFO("EnableArticaInNGINX", $_POST["EnableArticaInNGINX"]);
    $sock->getFrameWork("cmd.php?restart-artica-status=yes");
    $sock->getFrameWork("cmd.php?freeweb-restart=yes");
    $squid = new squidbee();
    $squid->certificate_center = $_POST["certificate_center"];
    $squid->SaveToLdap();
}
function global_parameters_save()
{
    $sock = new sockets();
    $users = new usersMenus();
    $sock->SET_INFO("CacheReplacementPolicy", $_POST["CacheReplacementPolicy"]);
    $sock->SET_INFO("SquidDebugCacheProc", $_POST["SquidDebugCacheProc"]);
    $sock->SET_INFO("DisableAnyCache", $_POST["DisableAnyCache"]);
    if (isset($_POST["ForceWindowsUpdateCaching"])) {
        $sock->SET_INFO("ForceWindowsUpdateCaching", $_POST["ForceWindowsUpdateCaching"]);
    }
    $sock->SET_INFO("ProxyDedicateMicrosoftRules", $_POST["ProxyDedicateMicrosoftRules"]);
    if (isset($_POST["EnableSQUIDSMP"])) {
        if ($_POST["EnableSQUIDSMP"] == 1) {
            $sock->SET_INFO("DisableSquidSMP", 0);
        } else {
            $sock->SET_INFO("DisableSquidSMP", 1);
        }
    }
    $squid = new squidbee();
    if (is_numeric($_POST["cache_mem"])) {
        $squid->global_conf_array["cache_mem"] = trim($_POST["cache_mem"]) . " MB";
    }
    if (is_numeric($_POST["read_ahead_gap"])) {
        $squid->global_conf_array["read_ahead_gap"] = trim($_POST["read_ahead_gap"]) . " MB";
    }
    if (is_numeric($_POST["cache_swap_low"])) {
        $squid->global_conf_array["cache_swap_low"] = trim($_POST["cache_swap_low"]);
    }
    if (is_numeric($_POST["cache_swap_high"])) {
        $squid->global_conf_array["cache_swap_high"] = trim($_POST["cache_swap_high"]);
    }
    if (is_numeric($_POST["minimum_object_size"])) {
        $squid->global_conf_array["minimum_object_size"] = trim($_POST["minimum_object_size"]) . " KB";
    }
    $squid->global_conf_array["maximum_object_size"] = $_POST["maximum_object_size"] . " MB";
    $squid->SaveToLdap(true);
}
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.ini.inc');
include_once(dirname(__FILE__).'/ressources/class.main_cf.inc');
include_once(dirname(__FILE__).'/ressources/class.amavis.inc');
include_once(dirname(__FILE__).'/ressources/class.samba.inc');
include_once(dirname(__FILE__).'/ressources/class.squid.inc');

$main=new main_cf();
$main->save_conf();
$main->save_conf_to_server(1);

$amavis=new amavis();
$amavis->Save();
$amavis->SaveToServer();

$samba=new samba();
$samba->SaveToLdap();

$squid=new squidbee();
$squid->SaveToLdap();
$squid->SaveToServer();

system('/etc/init.d/artica-postfix restart postfix');
system('/etc/init.d/artica-postfix restart squid');
system('/etc/init.d/artica-postfix restart samba');
system('/usr/share/artica-postfix/bin/artica-install --cyrus-checkconfig');
system('/etc/init.d/artica-postfix restart imap');
system('/etc/init.d/artica-postfix restart saslauthd');

?>
function save()
{
    $squid = new squidbee();
    $squid->forwarded_for = $_POST["forwarded_for"];
    $squid->SaveToLdap(true);
}
function save(){
	$squid=new squidbee();
	$squid->global_conf_array["cache_mem"]=trim($_POST["cache_mem"])." MB";
	$squid->global_conf_array["read_ahead_gap"]=trim($_POST["read_ahead_gap"])." MB";
	$squid->global_conf_array["maximum_object_size_in_memory"]=trim($_POST["maximum_object_size_in_memory"]);
	$squid->SaveToLdap(true);
}
Exemple #28
0
function whitelist_del()
{
    $sql = "DELETE FROM squid_ssl WHERE ID={$_GET["website_ssl_del"]}";
    $q = new mysql();
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $s = new squidbee();
    $s->SaveToLdap();
}
Exemple #29
0
function save(){
	$squid=new squidbee();
	$sock=new sockets();
	$sock->SET_INFO("DisableTCPEn", $_POST["DisableTCPEn"]);
	$sock->SET_INFO("DisableTCPWindowScaling", $_POST["DisableTCPWindowScaling"]);
	$sock->SET_INFO("SquidUploadTimeouts", $_POST["SquidUploadTimeouts"]);
	
	
	unset($_POST["SquidUploadTimeouts"]);
	unset($_POST["DisableTCPEn"]);
	unset($_POST["DisableTCPWindowScaling"]);
	while (list ($index, $line) = each ($_POST)){
		$squid->$index=$line;
		
	}
	
	$squid->SaveToLdap(true);
}
function delete_cache()
{
    $cachedir = base64_decode($_POST["delete-cache"]);
    $squid = new squidbee();
    unset($squid->cache_list[$cachedir]);
    $sock = new sockets();
    $squid->SaveToLdap(true);
    $squid->SaveToServer(true);
}