function listen_port_save() { if (!is_numeric($_GET["listenport"])) { return null; } if (CheckTomcatPort($_GET["listenport"])) { echo "Apache Tomcat use 8080 port try other port eg:3128 !"; return; } $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 ($_GET["listenport"] == $FreeWebListen) { $sock->SET_INFO("FreeWebListen", $_GET["listenport"] + 1); } if ($_GET["ssl_port"] == $FreeWebListenSSLPort) { $sock->SET_INFO("FreeWebListenSSLPort", $_GET["ssl_port"] + 1); } $squid = new squidbee(); $squid->listen_port = $_GET["listenport"]; $squid->second_listen_port = $_GET["second_listen_port"]; $squid->ICP_PORT = $_GET["icp_port"]; $squid->HTCP_PORT = $_GET["htcp_port"]; $squid->ssl_port = $_GET["ssl_port"]; $squid->certificate_center = $_GET["certificate_center"]; $sock->SET_INFO("SquidOldHTTPPort", $squid->listen_port); $sock->SET_INFO("SquidOldSSLPort", $squid->ssl_port); $sock->SET_INFO("SquidOldHTTPPort2", $squid->second_listen_port); $sock->SET_INFO("CNTLMPort", $_GET["CNTLMPort"]); $sock->SET_INFO("DisableSSLStandardPort", $_GET["DisableSSLStandardPort"]); $sock->SET_INFO("smartphones_port", $_GET["smartphones_port"]); $sock->SET_INFO("EnableTCPOptimize", $_GET["EnableTCPOptimize"]); if (!$squid->SaveToLdap()) { echo $squid->ldap_error; exit; } else { $tpl = new templates(); echo $tpl->javascript_parse_text("{listen_port}:{$_GET["listenport"]}\n", 1); echo $tpl->javascript_parse_text("{second_port}:{$_GET["second_listen_port"]}\n", 1); echo $tpl->javascript_parse_text("{ssl_port}:{$_GET["ssl_port"]}\n", 1); echo $tpl->javascript_parse_text("{icp_port}:{$_GET["icp_port"]}\n", 1); echo $tpl->javascript_parse_text("{htcp_port}:{$_GET["htcp_port"]}\n", 1); echo $tpl->javascript_parse_text("{cntlm_port}:{$_GET["cntlm_port"]}\n", 1); echo $tpl->javascript_parse_text("{smartphones_port}:{$_GET["smartphones_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("services.php?KernelTuning=yes"); $sock->getFrameWork("cmd.php?restart-apache-src=yes"); $sock->getFrameWork("squid.php?cntlm-restart=yes"); }
function listen_port_save() { if (!is_numeric($_GET["listenport"])) { return null; } if (CheckTomcatPort($_GET["listenport"])) { echo "Apache Tomcat use 8080 port try other port eg:3128 !"; return; } $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:{$_GET["listenport"]} ({success})"); } }