function popup_settings() { $sock = new sockets(); $tpl = new templates(); $page = CurrentPageName(); $sabnzbdplusDir = $sock->GET_INFO("sabnzbdplusDir"); $sabnzbdplusPort = $sock->GET_INFO("sabnzbdplusPort"); $sabnzbdplusIpAddr = $sock->GET_INFO("sabnzbdplusIpAddr"); if ($sabnzbdplusDir == null) { $sabnzbdplusDir = "/home/sabnzbdplus"; } if (!is_numeric($sabnzbdplusPort)) { $sabnzbdplusPort = "9666"; } if ($sabnzbdplusIpAddr == null) { $sabnzbdplusIpAddr = "0.0.0.0"; } $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); while (list($num, $ligne) = each($ips)) { $wbconsole[] = "<li><a href='http://{$num}:{$sabnzbdplusPort}' style='font-size:13px;text-decoration:underline'>http://{$num}:{$sabnzbdplusPort}</a></li>"; } reset($ips); $ips["0.0.0.0"] = "{all}"; $nets = Field_array_Hash($ips, "sabnzbdplusIpAddr", $sabnzbdplusIpAddr, "style:font-size:13px;padding:3px"); $html = "\n\t<div id='sabnzbdplus-id'>\n\t<table style='width:99.5%' class=form>\n\t<tr>\n\t\t<td class=legend>{enable_sabnzbdplus}:</td>\n\t\t<td>" . Field_checkbox("EnableSabnZbdPlus", 1, $sock->GET_INFO("EnableSabnZbdPlus")) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{working_directory}:</td>\n\t\t<td>" . Field_text("sabnzbdplusDir", $sabnzbdplusDir, "font-size:13px;padding:3px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{listen_http_port}:</td>\n\t\t<td>" . Field_text("sabnzbdplusPort", $sabnzbdplusPort, "font-size:13px;padding:3px;width:40px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{listen_ip}:</td>\n\t\t<td>{$nets}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "sabnzbdplusSave()") . "</td>\n\t</tr>\t\n\t</table>\n\t<hr>\n\t<H3>{web_console_access}:</H3><br>" . @implode("\n", $wbconsole) . "\n\t\n\t<script>\n\t\n\tvar x_sabnzbdplusSave= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tRefreshTab('TAB_APP_SABNZBDPLUS');\n\t\t\n\t}\t\n\t\n\t\tfunction sabnzbdplusSave(){\n\t\t\tvar XHR=XHRParseElements('sabnzbdplus-id');\n\t\t\tdocument.getElementById('sabnzbdplus-id').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_sabnzbdplusSave);\n\t\t}\n\t\n\t</script>"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $tcp = new networking(); $EnableDNSLinker = $sock->GET_INFO("EnableDNSLinker"); $EnableDNSLinkerCreds = unserialize(base64_decode($sock->GET_INFO("EnableDNSLinkerCreds"))); if (preg_match("#^(.+?):#", $EnableDNSLinkerCreds["CREDS"], $re)) { $SuperAdmin = $re[1]; } $hostname = $EnableDNSLinkerCreds["hostname"]; $listen_port = $EnableDNSLinkerCreds["listen_port"]; $listen_ip = $EnableDNSLinkerCreds["listen_addr"]; $send_listen_ip = $EnableDNSLinkerCreds["send_listen_ip"]; if (!is_numeric($EnableDNSLinker)) { $EnableDNSLinker = 0; } if (!is_numeric($listen_port)) { $listen_port = 9000; } $t = time(); $p = Paragraphe_switch_img("{activate_dns_linker}", "{activate_dns_linker_text}", "EnableDNSLinker", $EnableDNSLinker, null, 500); $ips = $tcp->ALL_IPS_GET_ARRAY(); $html = "<table style='width:100%' class=form>\n\t<tr>\n\t\t<td colspan=2>{$p}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{hostname}:</td>\n\t\t<td>" . Field_text("hostname-{$t}", $hostname, "font-size:16px;width:99%") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{listen_port}:</td>\n\t\t<td>" . Field_text("listen_port-{$t}", $listen_port, "font-size:16px;width:90px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{SuperAdmin}:</td>\n\t\t<td>" . Field_text("SuperAdmin", $SuperAdmin, "font-size:16px;width:99%") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{password}:</td>\n\t\t<td>" . Field_password("SuperAdminPass", null, "font-size:16px;width:70%") . "</td>\n\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{listen_ip}:</td>\n\t\t\t<td>" . Field_array_Hash($ips, "listen_addr-{$t}", $listen_ip, "style:font-size:16px;padding:3px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{send_listen_ip}:</td>\n\t\t\t<td>" . Field_array_Hash($ips, "send_listen_ip-{$t}", $send_listen_ip, "style:font-size:16px;padding:3px") . "</td>\n\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", "18") . "</td>\n\t</tr>\t\t\t\t\t\t\t\t\n\t</table>\t\t\n\t<script>\n\t\n\tvar x_Save{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tYahooWin3Hide();\n\t}\t\n\t\t\n\t\tfunction Save{$t}(){\n\t\t\tvar SuperAdminPass=document.getElementById('SuperAdminPass').value;\n\t\t\tif(SuperAdminPass.length==0){\n\t\t\t\talert('Please, define the password...\\n');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar pp=encodeURIComponent(document.getElementById('SuperAdminPass').value);\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('EnableDNSLinker',document.getElementById('EnableDNSLinker').value);\n\t\t\tXHR.appendData('SuperAdmin',document.getElementById('SuperAdmin').value);\n\t\t\tXHR.appendData('hostname',document.getElementById('hostname-{$t}').value);\n\t\t\tXHR.appendData('listen_port',document.getElementById('listen_port-{$t}').value);\n\t\t\tXHR.appendData('listen_addr',document.getElementById('listen_addr-{$t}').value);\n\t\t\tXHR.appendData('send_listen_ip',document.getElementById('send_listen_ip-{$t}').value);\n\t\t\tXHR.appendData('SuperAdminPass',pp);\n\t\t\tAnimateDiv('EnableDNSLinker_img');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\t\t\t\n\t\t\n\t\t}\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $squid = new squidbee(); $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $WCCP = 1; $arrayParams = unserialize(base64_decode($sock->getFrameWork("squid.php?compile-list=yes"))); $t = time(); $ip = new networking(); $ipsH = $ip->ALL_IPS_GET_ARRAY(); $SquidWCCPEnabled = $sock->GET_INFO("SquidWCCPEnabled"); if (!is_numeric($SquidWCCPEnabled)) { $SquidWCCPEnabled = 0; } if (!isset($arrayParams["--enable-wccpv2"])) { $WCCP = 0; } $WCCPHash = unserialize(base64_decode($sock->GET_INFO("WCCPHash"))); $wccp2_forwarding_method_hash = array(1 => "{wccp2_forwarding_method_hash_1}", 2 => "{wccp2_forwarding_method_hash_2}"); $wccp2_return_method_hash = array("gre" => "GRE encapsulation"); $wccp2_assignment_method_hash = array("hash" => "Hash assignment", "mask" => "Mask assignment"); $html = "\n<div style='font-size:22px'>{WCCP_NAME}</div>\n<div class=explain style='font-size:14px'>{WCCP_HOWTO}</div>\n<div id='SquidAVParamWCCP' style='width:98%' class=form>\n<table style='width:100%'>\n\t<tr>\n\t<td style='font-size:16px;' class=legend>{wccp2_enabled}:</td>\n\t<td>" . Field_checkbox("wccp2_enabled", 1, $squid->wccp2_enabled, "wccp2_enabled()") . "</td>\n\t<td> </td>\n\t</tr>\n\n\n\t<tr>\n\t\t<td style='font-size:16px' class=legend nowrap>{wccp2_routers}:</td>\n\t\t<td>" . Field_text("wccp2_router", $WCCPHash["wccp2_router"], "font-size:16px;padding:3px;width:320px") . "</td>\n\t\t<td>" . help_icon("{wccp2_routers_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:16px' class=legend nowrap>{listen_address}:</td>\n\t\t<td>" . Field_array_Hash($ipsH, "listen_address-{$t}", $WCCPHash["listen_address"], "style:font-size:16px") . "</td>\n\t\t<td></td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:16px' class=legend nowrap>{wccp2_forwarding_method}:</td>\n\t\t<td>" . Field_array_Hash($wccp2_forwarding_method_hash, "wccp2_forwarding_method", $WCCPHash["wccp2_forwarding_method"], "style:font-size:16px") . "</td>\n\t\t<td> </td>\n\t</tr>\n\n\t<tr>\n\t\t<td style='font-size:16px' class=legend nowrap>{wccp2_return_method}:</td>\n\t\t<td>" . Field_array_Hash($wccp2_return_method_hash, "wccp2_return_method", $WCCPHash["wccp2_return_method"], "style:font-size:16px") . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:16px' class=legend nowrap>{wccp2_assignment_method}:</td>\n\t\t<td>" . Field_array_Hash($wccp2_assignment_method_hash, "wccp2_assignment_method", $WCCPHash["wccp2_assignment_method"], "style:font-size:16px") . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'>\n\t\t\t<hr>\n\t\t\t\t" . button("{apply}", "SquidWccp2ParamSave()", 18) . "\n\t\t</td>\n\t</tr>\n\t</table>\n</div>\n<script>\nvar X_SquidWccp2ParamSave= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadjs('squid.restart.php?prepare-js=yes');\n\t\n}\n\nfunction SquidWccp2ParamSave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('wccp2_enabled').checked){\n\t\tXHR.appendData('wccp2_enabled',1);\n\t}else{\n\t\tXHR.appendData('wccp2_enabled',0);\n\t}\n\tXHR.appendData('wccp2_router',\n\tdocument.getElementById('wccp2_router').value);\n\n\tXHR.appendData('wccp2_forwarding_method',\n\tdocument.getElementById('wccp2_forwarding_method').value);\n\n\tXHR.appendData('wccp2_return_method',\n\tdocument.getElementById('wccp2_return_method').value);\n\n\tXHR.appendData('wccp2_assignment_method',\n\tdocument.getElementById('wccp2_assignment_method').value);\n\t\n\tXHR.appendData('listen_address',\n\tdocument.getElementById('listen_address-{$t}').value);\n\n\tXHR.sendAndLoad('{$page}', 'POST',X_SquidWccp2ParamSave);\n}\n\n\nfunction wccp2_disable_all(){\n\tdocument.getElementById('wccp2_forwarding_method').disabled=true;\n\tdocument.getElementById('wccp2_router').disabled=true;\n\tdocument.getElementById('wccp2_forwarding_method').disabled=true;\n\tdocument.getElementById('wccp2_return_method').disabled=true;\n\tdocument.getElementById('wccp2_assignment_method').disabled=true;\n\tdocument.getElementById('listen_address-{$t}').disabled=true;\n\t\n}\nfunction wccp2_enable_all(){\n\tdocument.getElementById('wccp2_forwarding_method').disabled=false;\n\tdocument.getElementById('wccp2_router').disabled=false;\n\tdocument.getElementById('wccp2_forwarding_method').disabled=false;\n\tdocument.getElementById('wccp2_return_method').disabled=false;\n\tdocument.getElementById('wccp2_assignment_method').disabled=false;\n\tdocument.getElementById('listen_address-{$t}').disabled=false;\n}\n\nfunction wccp2_enabled(){\n\twccp2_disable_all();\n\tvar wccp2={$WCCP};\n\tif(wccp2==0){\n\t\tdocument.getElementById('wccp2_enabled').disabled=true;\n\t\tdocument.getElementById('wccp2_enabled').checked=false;\n\t}\n\tif(document.getElementById('wccp2_enabled').checked){wccp2_enable_all();}\n}\n\nwccp2_enabled();\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function SAVE_SERVER() { $tpl = new templates(); if (trim($vpn->main_array["GLOBAL"]["IP_START"]) == null) { $vpn->main_array["GLOBAL"]["IP_START"] = "10.8.0.0"; } if (preg_match("#^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.#", $vpn->main_array["GLOBAL"]["IP_START"], $re)) { $IP_START_CONFIG = "{$re[1]}.{$re[2]}.{$re[3]}"; } if (isset($_POST["IP_START"])) { preg_match("#^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.#", $_POST["IP_START"], $re); $startip = "{$re[1]}.{$re[2]}.{$re[3]}"; $ips = new networking(); $ipsArray = $ips->ALL_IPS_GET_ARRAY(); while (list($localip, $ligne) = each($ipsArray)) { preg_match("#^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.#", $localip, $re); $currentIP = "{$re[1]}.{$re[2]}.{$re[3]}"; if ($currentIP == $IP_START_CONFIG) { continue; } if ($currentIP == $startip) { echo $tpl->javascript_parse_text("{ERROR_OPENVPN_CLIENTISSAMEIPSERVER}\n`{$currentIP}` = `{$startip}`"); $_POST["IP_START"] = "10.8.0.0"; return; } } } $vpn = new openvpn(); while (list($num, $ligne) = each($_POST)) { $vpn->main_array["GLOBAL"][$num] = $ligne; } $vpn->Save(); }
function popup() { $mysql = new mysqlserver(); $net = new networking(); $array = $net->ALL_IPS_GET_ARRAY(); $sock = new sockets(); $EnableZarafaTuning = $sock->GET_INFO("EnableZarafaTuning"); if (!is_numeric($EnableZarafaTuning)) { $EnableZarafaTuning = 0; } $users = new usersMenus(); if (!$users->ZARAFA_INSTALLED) { $EnableZarafaTuning = 0; } $array[null] = "{loopback}"; $bind = Field_array_Hash($array, "bind-address", $mysql->main_array["bind-address"], null, null, 0, "font-size:13px;padding:3px"); $chars = Charsets(); $charsets = Field_array_Hash($chars, "default-character-set", $mysql->main_array["default-character-set"], null, null, 0, "font-size:13px;padding:3px"); //Les devs de mysql conseillent un key_buffer de la taille de la somme de tous les fichiers .MYI dans le repertoire mysql. $hover = CellRollOver(); $form = "\t<table style='width:100%' class=form>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-external-locking}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-external-locking', $mysql->main_array["skip_external_locking"]) . "</td>\n\t\t<td><code>skip-external-locking</code></td>\n\t\t<td>" . help_icon('{skip-external-locking_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-character-set-client-handshake}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-character-set-client-handshake', $mysql->main_array["skip-character-set-client-handshake"]) . "</td>\n\t\t<td><code>skip-character-set-client-handshake</code></td>\n\t\t<td>" . help_icon('{skip-character-set-client-handshake_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>Default charset:</td>\n\t\t<td colspan=3>{$charsets}</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{bind-address}:</td>\n\t\t<td>{$bind}</td>\n\t\t<td><code>bind-address</code></td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer}:</td>\n\t\t<td>" . Field_text("key_buffer", $mysql->main_array["key_buffer"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>key_buffer</code></td>\n\t\t<td>" . help_icon('{key_buffer_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer_size}:</td>\n\t\t<td>" . Field_text("key_buffer_size", $mysql->main_array["key_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>key_buffer_size</code></td>\n\t\t<td>" . help_icon('{key_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_buffer_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_buffer_pool_size", $mysql->main_array["innodb_buffer_pool_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>innodb_buffer_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_buffer_pool_size_text}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_additional_mem_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_additional_mem_pool_size", $mysql->main_array["innodb_additional_mem_pool_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>innodb_additional_mem_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_additional_mem_pool_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{myisam_sort_buffer_size}:</td>\n\t\t<td>" . Field_text("myisam_sort_buffer_size", $mysql->main_array["myisam_sort_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>myisam_sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{myisam_sort_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{sort_buffer_size}:</td>\n\t\t<td>" . Field_text("sort_buffer_size", $mysql->main_array["sort_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{sort_buffer_size_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{join_buffer_size}:</td>\n\t\t<td>" . Field_text("join_buffer_size", $mysql->main_array["join_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>join_buffer_size</code></td>\n\t\t<td>" . help_icon('{join_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_buffer_size}:</td>\n\t\t<td>" . Field_text("read_buffer_size", $mysql->main_array["read_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>read_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t\t<td class=legend>{query_cache_size}:</td>\n\t\t<td>" . Field_text("query_cache_size", $mysql->main_array["query_cache_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>query_cache_size</code></td>\n\t\t<td>" . help_icon('{query_cache_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{query_cache_limit}:</td>\n\t\t<td>" . Field_text("query_cache_limit", $mysql->main_array["query_cache_limit"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>query_cache_limit</code></td>\n\t\t<td>" . help_icon('{query_cache_limit_text}') . "</td>\n\t</tr>\t\n\t\n\t\n\n\t\n\t\n\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_rnd_buffer_size}:</td>\n\t\t<td>" . Field_text("read_rnd_buffer_size", $mysql->main_array["read_rnd_buffer_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>read_rnd_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_rnd_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{table_cache}:</td>\n\t\t<td>" . Field_text("table_cache", $mysql->main_array["table_cache"], "font-size:13px;width:60px;padding:3px") . " table(s)</td>\n\t\t<td><code>table_cache</code></td>\n\t\t<td>" . help_icon('{table_cache}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{tmp_table_size}:</td>\n\t\t<td>" . Field_text("tmp_table_size", $mysql->main_array["tmp_table_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>tmp_table_size</code></td>\n\t\t<td>" . help_icon('{tmp_table_size}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_allowed_packet}:</td>\n\t\t<td>" . Field_text("max_allowed_packet", $mysql->main_array["max_allowed_packet"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>max_allowed_packet</code></td>\n\t\t<td>" . help_icon('{max_allowed_packet}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_connections}:</td>\n\t\t<td>" . Field_text("max_connections", $mysql->main_array["max_connections"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>max_connections</code></td>\n\t\t<td>" . help_icon('{max_connections}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{net_buffer_length}:</td>\n\t\t<td>" . Field_text("net_buffer_length", $mysql->main_array["net_buffer_length"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>net_buffer_length</code></td>\n\t\t<td>" . help_icon('{net_buffer_length_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{thread_cache_size}:</td>\n\t\t<td>" . Field_text("thread_cache_size", $mysql->main_array["thread_cache_size"], "font-size:13px;width:60px;padding:3px") . " M</td>\n\t\t<td><code>thread_cache_size</code></td>\n\t\t<td>" . help_icon('{thread_cache_size_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'>\n\t\t<hr>" . button("{apply}", "SaveUMysqlParameters()") . "\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>"; $html = "<div style='font-size:16px'>{mysql_settings} v. {$mysql->mysql_version_string} ({$mysql->mysqlvbin})</H1>\n\t<div id='mysqlsettings'>{$form}</div>\n\t\n\t\n\t<script>\nfunction EnableZarafaTuningCheck(){\n\tvar EnableZarafaTuning={$EnableZarafaTuning};\n\tif(EnableZarafaTuning==0){return;}\n\tif(document.getElementById('innodb_buffer_pool_size')){document.getElementById('innodb_buffer_pool_size').disabled=true;}\n\tif(document.getElementById('query_cache_size')){document.getElementById('query_cache_size').disabled=true;}\n\tif(document.getElementById('innodb_log_file_size')){document.getElementById('innodb_log_file_size').disabled=true;}\n\tif(document.getElementById('innodb_log_buffer_size')){document.getElementById('innodb_log_buffer_size').disabled=true;}\n\tif(document.getElementById('max_allowed_packet')){document.getElementById('max_allowed_packet').disabled=true;}\n\tif(document.getElementById('max_connections')){document.getElementById('max_connections').disabled=true;}\n}\nEnableZarafaTuningCheck();\n</script>\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $t = time(); $nets = Field_array_Hash($ips, "{$t}-deny", null, "style:font-size:16px;padding:3px"); $html = "\n\t<div class=text-info style='font-size:14px'>{ban_addresses_for_interfaces_text}</div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{ipaddr}:</td>\n\t\t<tD>{$nets}</td>\n\t\t<td width=1%>" . button("{add}", "AddIpToBan()", 16) . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t<div id='baniplist-{$t}'></div>\n\t\n\t\n\t<script>\n\t\tfunction RefreshBanIP(){\n\t\t\tLoadAjax('baniplist-{$t}','{$page}?list=yes');\n\t\t}\n\t\t\n\tvar x_AddIpToBan= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);}\n\t\tRefreshBanIP();\n\t\t\n\t}\n\n\tfunction DeleteIpBan(ip){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('delete',ip);\n\t\tAnimateDiv('baniplist-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_AddIpToBan);\t\t\n\t}\n\t\t\n\tfunction AddIpToBan(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('plusdeny',document.getElementById('{$t}-deny').value);\n\t\tAnimateDiv('baniplist-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_AddIpToBan);\t\t\t\t\n\t}\t\t\n\t\n\tRefreshBanIP();\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $t = time(); $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $main = new maincf_multi($_GET["hostname"]); $ipaddr = $main->ip_addr; $nets = Field_array_Hash($ips, "{$t}-bind", $_COOKIE["TESTS-BIND"], "style:font-size:16px;padding:3px"); $html = "\n\t<div id='{$t}'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t<td class=legend style='font-size:14px'>{bind_address}:</td>\n\t<td style='font-size:16px;'> {$nets}</td>\n\t</tr>\t\n\t<tr>\n\t<td class=legend style='font-size:14px'>{destination}:</td>\n\t<td style='font-size:16px;'>{$ipaddr}</td>\n\t</tr>\t\n\t<tr>\n\t<td class=legend style='font-size:14px'>{from}:</td>\n\t<td> " . Field_text("{$t}-from", $_COOKIE["TESTS-FROM"], "font-size:16px;width:228px") . "</td>\n\t</tr>\t\n\t<tr>\n\t<td class=legend style='font-size:14px'>{to}:</td>\n\t<td> " . Field_text("{$t}-to", $_COOKIE["TESTS-TO"], "font-size:16px;width:228px") . "</td>\n\t</tr>\t\n\t<tr>\n\t<td class=legend style='font-size:14px'>{subject}:</td>\n\t<td> " . Field_text("{$t}-subject", $_COOKIE["TESTS-SUB"], "font-size:16px;width:350px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2 ><textarea id='{$t}-body' style='width:100%;height:150px;overflow:auto;border:1px solid black;font-size:14px'>{$_COOKIE["TESTS-BOD"]}</textarea>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "MultipleInstanceSendEmailTest()", 16) . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t\n\t\n\t<script>\n\t\n\tvar x_MultipleInstanceSendEmailTest= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);}\n\t\tdocument.getElementById('{$t}').innerHTML='';\n\t\t\n\t}\t\n\t\t\n\t\tfunction MultipleInstanceSendEmailTest(){\n\t\t\tSet_Cookie('TESTS-FROM', document.getElementById('{$t}-from').value, '3600', '/', '', '');\n\t\t\tSet_Cookie('TESTS-TO', document.getElementById('{$t}-to').value, '3600', '/', '', '');\n\t\t\tSet_Cookie('TESTS-SUB', document.getElementById('{$t}-subject').value, '3600', '/', '', '');\n\t\t\tSet_Cookie('TESTS-BOD', document.getElementById('{$t}-body').value, '3600', '/', '', '');\n\t\t\tSet_Cookie('TESTS-BIND', document.getElementById('{$t}-bind').value, '3600', '/', '', '');\n\t\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('TESTS-FROM',document.getElementById('{$t}-from').value);\n\t\t\tXHR.appendData('TESTS-TO',document.getElementById('{$t}-to').value);\n\t\t\tXHR.appendData('TESTS-SUB',document.getElementById('{$t}-subject').value);\n\t\t\tXHR.appendData('TESTS-BOD',document.getElementById('{$t}-body').value);\n\t\t\tXHR.appendData('TESTS-BIND',document.getElementById('{$t}-bind').value);\n\t\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\t\tXHR.appendData('ou','{$_GET["ou"]}');\t\t\t\n\t\t\tAnimateDiv('{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_MultipleInstanceSendEmailTest);\t\t\t\t\n\t\t}\n\t</script>\n\t<p> </p>\n\t<p> </p>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup_form() { $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $tpl = new templates(); $page = CurrentPageName(); $hostname = $_GET["hostname"]; $ID = $_GET["ID"]; $button_text = "{add}"; if (!is_numeric($ID)) { $ID = 0; } if ($ID > 0) { $sql = "SELECT * FROM ip_rotator_smtp WHERE ID={$ID}"; $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $button_text = "{apply}"; } while (list($ip, $none) = each($ips)) { $main = new maincf_multi(null, null, $ip); if ($main->myhostname != null) { $ips[$ip] = "{$ip} ({$main->myhostname})"; } } reset($ips); $ips[null] = "{select}"; $sources = Field_array_Hash($ips, "ip-src-list", $ligne["ipsource"], "FillIpSrc()", null, 0, "font-size:14px;padding:3px"); $sources2 = Field_array_Hash($ips, "ip-dest-list", $ligne["ipdest"], "FillIpDest()", null, 0, "font-size:14px;padding:3px"); $mode[null] = "{select}"; $mode["nth"] = "{counter}"; $mode["random"] = "{random}"; $tip_src_table = "<tr>\n\t\t<td class=legend>{connections_for}:</td>\n\t\t<td>{$sources}</td>\n\t\t<td>" . Field_text("ip-src", $ligne["ipsource"], "font-size:14px;width:120px") . "</td>\n\t</tr>"; if ($hostname != "master") { $main = new maincf_multi($hostname, $_GET["ou"]); $tip_src_table = "<tr>\n\t\t\t<td class=legend>{connections_for}:</td>\n\t\t\t<td style='font-size:14px'>{$main->ip_addr} <input type='hidden' value='{$main->ip_addr}' id='ip-src'></td>\n\t\t\t<td> </td>\n\t\t</tr>"; $sql = "SELECT ipaddr FROM nics_virtuals WHERE org='{$_GET["ou"]}'"; $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2>"; } unset($ips); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $main = new maincf_multi(null, $_GET["ou"], $ligne["ipaddr"]); $ips[$ligne["ipaddr"]] = "{$ligne["ipaddr"]} ({$main->myhostname})"; } $sources2 = Field_array_Hash($ips, "ip-dest-list", $ligne["ipdest"], "FillIpDest()", null, 0, "font-size:14px;padding:3px"); } $html = "\t<table style='width:100%' class=form>\n{$tip_src_table}\n\t<tr>\n\t\t<td class=legend>{switch_mode}:</td>\n\t\t<td>" . Field_array_Hash($mode, "ip-mode", $ligne["mode"], "FillFormMode()", null, 0, "font-size:14px;padding:3px") . "</td>\n\t\t<td><span id='form-rotator-mode'></span></td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{destination}:</td>\n\t\t<td>{$sources2}</td>\n\t\t<td>" . Field_text("ip-dest", $ligne["ipdest"], "font-size:14px;width:120px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'>\n\t\t\t<hr>" . button($button_text, "AddNewIprotator({$ID})") . "</td>\n\t</tr>\n\t\n\t</table>\n\t\n\t<script>\n\tfunction FillFormMode(){\n\t\tLoadAjax('form-rotator-mode','{$page}?form-rotator-mode='+document.getElementById('ip-mode').value+'&ID={$ID}');\n\t\n\t}\n\tFillFormMode();\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup(){ $sock=new sockets(); $page=CurrentPageName(); $ZarafaDeliverBind=$sock->GET_INFO("ZarafaDeliverBind"); if($ZarafaDeliverBind==null){$ZarafaDeliverBind="127.0.0.1";} $net=new networking(); $nets=$net->ALL_IPS_GET_ARRAY(); $nets["0.0.0.0"]="{all}"; $t=time(); $html=" <div id='div-$t'></div> <div class=text-info style='font-size:16px'>{delivery_agent_parameters_text}</div> <div style='text-align:right'><a href=\"javascript:blur();\" OnClick=\"javascript:s_PopUpFull('http://www.mail-appliance.org/index.php?cID=328','1024','900');\" style='font-size:16px;text-decoration:underline'>{online_help}</a></div> <table style='width:99%' class=form> <tr> <td class=legend style='font-size:16px'>{listen_ip}:</td> <td style='font-size:16px'>". Field_array_Hash($nets, "ZarafaDeliverBind-$t",$ZarafaDeliverBind,null,null,0,"font-size:16px")." :2003</td> </tr> <tr> <td align='right' colspan=2><hr>". button("{apply}","Zarafa$t()","18px")."</td> </tr> </table> <script> var x_Zarafa$t= function (obj) { var tempvalue=obj.responseText; if(tempvalue.length>3){alert(tempvalue)}; document.getElementById('div-$t').innerHTML=''; } function Zarafa$t(){ var XHR = new XHRConnection(); var ZarafadAgentJunk=0; XHR.appendData('ZarafaDeliverBind',document.getElementById('ZarafaDeliverBind-$t').value); AnimateDiv('div-$t'); XHR.sendAndLoad('$page', 'POST',x_Zarafa$t); } </script> "; $tpl=new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $mysql = new mysqlserver(); $net = new networking(); $array = $net->ALL_IPS_GET_ARRAY(); $array[null] = "{all}"; $bind = Field_array_Hash($array, "bind-address", $mysql->main_array["bind-address"]); //Les devs de mysql conseillent un key_buffer de la taille de la somme de tous les fichiers .MYI dans le repertoire mysql. $hover = CellRollOver(); $form = "\t<table style='width:100%'>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-external-locking}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-external-locking', $mysql->main_array["skip_external_locking"]) . "</td>\n\t\t<td><code>skip-external-locking</code></td>\n\t\t<td>" . help_icon('{skip-external-locking_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{bind-address}:</td>\n\t\t<td>{$bind}</td>\n\t\t<td><code>bind-address</code></td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer}:</td>\n\t\t<td>" . Field_text("key_buffer", $mysql->main_array["key_buffer"], "width:60px") . " M</td>\n\t\t<td><code>key_buffer</code></td>\n\t\t<td>" . help_icon('{key_buffer_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer_size}:</td>\n\t\t<td>" . Field_text("key_buffer_size", $mysql->main_array["key_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>key_buffer_size</code></td>\n\t\t<td>" . help_icon('{key_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_buffer_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_buffer_pool_size", $mysql->main_array["innodb_buffer_pool_size"], "width:60px") . " M</td>\n\t\t<td><code>innodb_buffer_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_buffer_pool_size_text}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_additional_mem_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_additional_mem_pool_size", $mysql->main_array["innodb_additional_mem_pool_size"], "width:60px") . " M</td>\n\t\t<td><code>innodb_additional_mem_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_additional_mem_pool_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{myisam_sort_buffer_size}:</td>\n\t\t<td>" . Field_text("myisam_sort_buffer_size", $mysql->main_array["myisam_sort_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>myisam_sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{myisam_sort_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{sort_buffer_size}:</td>\n\t\t<td>" . Field_text("sort_buffer_size", $mysql->main_array["sort_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{sort_buffer_size_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{join_buffer_size}:</td>\n\t\t<td>" . Field_text("join_buffer_size", $mysql->main_array["join_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>join_buffer_size</code></td>\n\t\t<td>" . help_icon('{join_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_buffer_size}:</td>\n\t\t<td>" . Field_text("read_buffer_size", $mysql->main_array["read_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>read_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t\t<td class=legend>{query_cache_size}:</td>\n\t\t<td>" . Field_text("query_cache_size", $mysql->main_array["query_cache_size"], "width:60px") . " M</td>\n\t\t<td><code>query_cache_size</code></td>\n\t\t<td>" . help_icon('{query_cache_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{query_cache_limit}:</td>\n\t\t<td>" . Field_text("query_cache_limit", $mysql->main_array["query_cache_limit"], "width:60px") . " M</td>\n\t\t<td><code>query_cache_limit</code></td>\n\t\t<td>" . help_icon('{query_cache_limit_text}') . "</td>\n\t</tr>\t\n\t\n\t\n\n\t\n\t\n\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_rnd_buffer_size}:</td>\n\t\t<td>" . Field_text("read_rnd_buffer_size", $mysql->main_array["read_rnd_buffer_size"], "width:60px") . " M</td>\n\t\t<td><code>read_rnd_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_rnd_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{table_cache}:</td>\n\t\t<td>" . Field_text("table_cache", $mysql->main_array["table_cache"], "width:60px") . " table(s)</td>\n\t\t<td><code>table_cache</code></td>\n\t\t<td>" . help_icon('{table_cache}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{tmp_table_size}:</td>\n\t\t<td>" . Field_text("tmp_table_size", $mysql->main_array["tmp_table_size"], "width:60px") . " M</td>\n\t\t<td><code>tmp_table_size</code></td>\n\t\t<td>" . help_icon('{tmp_table_size}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_allowed_packet}:</td>\n\t\t<td>" . Field_text("max_allowed_packet", $mysql->main_array["max_allowed_packet"], "width:60px") . " M</td>\n\t\t<td><code>max_allowed_packet</code></td>\n\t\t<td>" . help_icon('{max_allowed_packet}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_connections}:</td>\n\t\t<td>" . Field_text("max_connections", $mysql->main_array["max_connections"], "width:60px") . " M</td>\n\t\t<td><code>max_connections</code></td>\n\t\t<td>" . help_icon('{max_connections}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{net_buffer_length}:</td>\n\t\t<td>" . Field_text("net_buffer_length", $mysql->main_array["net_buffer_length"], "width:60px") . " M</td>\n\t\t<td><code>net_buffer_length</code></td>\n\t\t<td>" . help_icon('{net_buffer_length_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{thread_cache_size}:</td>\n\t\t<td>" . Field_text("thread_cache_size", $mysql->main_array["thread_cache_size"], "width:60px") . " M</td>\n\t\t<td><code>thread_cache_size</code></td>\n\t\t<td>" . help_icon('{thread_cache_size_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'>\n\t\t<hr>" . button("{apply}", "SaveUMysqlParameters()") . "\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>"; $html = "<H1>{mysql_settings} v. {$mysql->mysql_version_string} ({$mysql->mysqlvbin})</H1>\n\t<div id='mysqlsettings'>" . RoundedLightWhite($form) . "</div>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $SquidBinIpaddr = $sock->GET_INFO("SquidBinIpaddr"); $MikrotikTransparent = intval($sock->GET_INFO('MikrotikTransparent')); $ip = new networking(); $t = time(); $pfws = $ip->ALL_IPS_GET_ARRAY(); $pfws[null] = "{none}"; if ($MikrotikTransparent == 0) { $squid = new squidbee(); $tcp_outgoing_address = $squid->global_conf_array["tcp_outgoing_address"]; $ips = $ip->ALL_IPS_GET_ARRAY(); $ips["0.0.0.0"] = "{all}"; $ff1 = "<tr>\n\t\t<td class=legend style='font-size:16px'>{forward_address}:</td>\n\t\t<td style='font-size:16px'>" . Field_array_Hash($pfws, "tcp_outgoing_address", $tcp_outgoing_address, "style:font-size:16px") . "<td>\n\t\t<td style='font-size:16px' width=1%><td>\n\t</tr>"; } else { $MikrotikVirtualIP = $sock->GET_INFO('MikrotikVirtualIP'); $ff1 = "\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{forward_address}:</td>\n\t\t\t<td style='font-size:16px'><strong>MikroTik:{$MikrotikVirtualIP}</strong><td>\n\t\t\t<td style='font-size:16px' width=1%><td>\n\t\t</tr>"; } $html = "\n\t<div id='{$t}'>\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{listen_address}:</td>\n\t\t<td style='font-size:16px'>" . Field_array_Hash($ips, "bindip-{$t}", $SquidBinIpaddr, "style:font-size:16px") . "<td>\n\t\t<td style='font-size:16px' width=1%><td>\n\t</tr>\n\t{$ff1}\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SaveSquidBinIpaddr()", 16) . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>\n<script>\n\tvar x_SaveSquidBinIpaddr=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tYahooWin3Hide();\n\t\tLoadjs('squid.restart.php?onlySquid=yes&ask=yes');\n\t}\t\n\t\n\tfunction SaveSquidBinIpaddr(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SquidBinIpaddr',document.getElementById('bindip-{$t}').value);\n\t\tif(document.getElementById('tcp_outgoing_address')){\n\t\t\tXHR.appendData('tcp_outgoing_address',document.getElementById('tcp_outgoing_address').value);\n\t\t\t}\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveSquidBinIpaddr);\t\n\t}\t\t\n</script>\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $FreeRadiusListenIP = $sock->GET_INFO("FreeRadiusListenIP"); $FreeRadiusListenPort = $sock->GET_INFO("FreeRadiusListenPort"); if ($FreeRadiusListenIP == "0.0.0.0") { $FreeRadiusListenIP = null; } if (!is_numeric($FreeRadiusListenPort)) { $FreeRadiusListenPort = 1812; } $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $ips[null] = "{all}"; $t = time(); $html = "\n\t<div id='{$t}'>\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{listen_address}:</td>\n\t\t<td style='font-size:16px'>" . Field_array_Hash($ips, "FreeRadiusListenIP-{$t}", $FreeRadiusListenIP, "style:font-size:16px") . "<td>\n\t\t<td style='font-size:16px' width=1%><td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{listen_port}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("FreeRadiusListenPort-{$t}", $FreeRadiusListenPort, "font-size:16px;width:90px") . "<td>\n\t\t<td style='font-size:16px' width=1%><td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "Save{$t}()", 16) . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>\n<script>\n\tvar x_Save{$t}=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tYahooWin3Hide();\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeRadiusListenPort',document.getElementById('FreeRadiusListenPort-{$t}').value);\n\t\tXHR.appendData('FreeRadiusListenIP',document.getElementById('FreeRadiusListenIP-{$t}').value);\n\t\tAnimateDiv('{$t}'); \n\t\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\t\n\t}\t\t\n</script>\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function status() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $ip = new networking(); $t = time(); $SquidAsMasterPeer = intval($sock->GET_INFO("SquidAsMasterPeer")); $SquidAsMasterPeerPort = intval($sock->GET_INFO("SquidAsMasterPeerPort")); $SquidAsMasterPeerPortSSL = intval($sock->GET_INFO("SquidAsMasterPeerPortSSL")); $SquidAsMasterPeerIPAddr = $sock->GET_INFO("SquidAsMasterPeerIPAddr"); $SquidAsMasterCacheChilds = $sock->GET_INFO("SquidAsMasterCacheChilds"); $SquidAsMasterLogExtern = intval($sock->GET_INFO("SquidAsMasterLogExtern")); $SquidAsMasterFollowxForward = intval($sock->GET_INFO("SquidAsMasterFollowxForward")); if ($SquidAsMasterPeerIPAddr == null) { $SquidAsMasterPeerIPAddr = "0.0.0.0"; } if ($SquidAsMasterPeerPort == 0) { $SquidAsMasterPeerPort = 8050; } if ($SquidAsMasterPeerPortSSL == 0) { $SquidAsMasterPeerPortSSL = 8051; } if (!is_numeric($SquidAsMasterCacheChilds)) { $SquidAsMasterCacheChilds = 1; } $SquidAsMasterLogChilds = intval($sock->GET_INFO("SquidAsMasterLogChilds")); $p1 = Paragraphe_switch_img("{enable_as_master_proxy}", "{enable_as_master_proxy_explain}", "SquidAsMasterPeer-{$t}", $SquidAsMasterPeer, null, 850); $p2 = Paragraphe_switch_img("{logging_childs_connections}", "{logging_childs_connections_explain}", "SquidAsMasterLogChilds-{$t}", $SquidAsMasterLogChilds, null, 850); $p21 = Paragraphe_switch_img("{logging_childs_connections2}", "{logging_childs_connections_explain2}", "SquidAsMasterLogExtern-{$t}", $SquidAsMasterLogExtern, null, 850); $p3 = Paragraphe_switch_img("{cache_childs_requests}", "{cache_childs_requests_explain}", "SquidAsMasterCacheChilds-{$t}", $SquidAsMasterCacheChilds, null, 850); $p4 = Paragraphe_switch_img("{follow_x_forwarded_for}", "{follow_x_forwarded_for_explain}", "SquidAsMasterFollowxForward-{$t}", $SquidAsMasterFollowxForward, null, 850); $ips = $ip->ALL_IPS_GET_ARRAY(); $ips["0.0.0.0"] = "{all}"; if ($SquidAsMasterFollowxForward == 1) { $error = "<p class=explain style='font-size:16px'>{SquidAsMasterFollowxForward_error}</p>"; } $html = "\n\t<div style='width:98%' class=form>\n\t\t<table style='width:100%'>\n\t\t\t<tr> <td colspan=2>{$p1}</td> </tr>\n\t\t\t<tr> <td colspan=2>{$p2}</td> </tr>\n\t\t\t<tr> <td colspan=2>{$p21}</td> </tr>\n\t\t\t<tr> <td colspan=2>{$p3}</td> </tr>\n\t\t\t<tr> <td colspan=2>{$p4}</td> </tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{listen_address}:</td>\n\t\t\t\t<td style='font-size:24px'>" . Field_array_Hash($ips, "SquidAsMasterPeerIPAddr-{$t}", $SquidAsMasterPeerIPAddr, "style:font-size:24px") . "<td>\n\t\t\t\t\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:24px'>{listen_port}:</td>\n\t\t\t\t<td >" . Field_text("SquidAsMasterPeerPort-{$t}", $SquidAsMasterPeerPort, "font-size:24px;width:100px") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:24px'>{listen_port} (SSL):</td>\n\t\t\t\t<td >" . Field_text("SquidAsMasterPeerPortSSL-{$t}", $SquidAsMasterPeerPortSSL, "font-size:24px;width:100px") . "</td>\n\t\t\t</tr>\t\t\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 32) . "</td>\n\t\t\t</tr>\t\n\t\t</table>\t\t\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){ alert(results); return; }\n\tRefreshTab('main_squid_childs_tabs');\n\tLoadjs('squid.reconfigure.php');\n\t\n}\n\t\nfunction Save{$t}(){\n\tvar enabled=1;\n\tvar XHR = new XHRConnection();\n\t\n\tXHR.appendData('SquidAsMasterPeer',document.getElementById('SquidAsMasterPeer-{$t}').value);\n\tXHR.appendData('SquidAsMasterLogChilds',document.getElementById('SquidAsMasterLogChilds-{$t}').value);\n\tXHR.appendData('SquidAsMasterPeerPort',document.getElementById('SquidAsMasterPeerPort-{$t}').value);\n\tXHR.appendData('SquidAsMasterPeerPortSSL',document.getElementById('SquidAsMasterPeerPortSSL-{$t}').value);\n\tXHR.appendData('SquidAsMasterPeerIPAddr',document.getElementById('SquidAsMasterPeerIPAddr-{$t}').value);\n\tXHR.appendData('SquidAsMasterCacheChilds',document.getElementById('SquidAsMasterCacheChilds-{$t}').value);\n\tXHR.appendData('SquidAsMasterLogExtern',document.getElementById('SquidAsMasterLogExtern-{$t}').value);\n\tXHR.appendData('SquidAsMasterFollowxForward',document.getElementById('SquidAsMasterFollowxForward-{$t}').value);\n\t\n\t\n\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $sock = new sockets(); $page = CurrentPageName(); $ZarafaiCalEnable = $sock->GET_INFO("ZarafaiCalEnable"); $ZarafaiCalPort = $sock->GET_INFO('ZarafaiCalPort'); if (!is_numeric($ZarafaiCalPort)) { $ZarafaiCalPort = 8088; } $ZarafaiCalBind = $sock->GET_INFO("ZarafaiCalBind"); if (strlen(trim($ZarafaiCalBind)) < 4) { $ZarafaiCalBind = "0.0.0.0"; } $t = time(); $net = new networking(); $nets = $net->ALL_IPS_GET_ARRAY(); $nets["0.0.0.0"] = "{all}"; $netfield = Field_array_Hash($nets, "ZarafaiCalBind-{$t}", $ZarafaiCalBind, "style:font-size:16px;padding:3px"); $html = "\n\t<div id='div-{$t}'></div>\n\t<div class=explain style='font-size:16px'>{ZARAFA_CALDAV_EXPLAIN}</div>\n\t\t<table style='width:99%' class=form>\n\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:16px'>{enable}:</td>\n\t\t\t\t<td>" . Field_checkbox("ZarafaiCalEnable-{$t}", 1, $ZarafaiCalEnable, "CheckZarafaiCal()") . "</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:16px'>{listen_addr}:</td>\n\t\t\t\t<td>{$netfield}</td>\n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:16px'>{listen_port}:</td>\n\t\t\t\t<td>" . Field_text("ZarafaiCalPort-{$t}", $ZarafaiCalPort, "font-size:16px;padding:3px;width:90px") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveZarafaIcal{$t}()", "16px") . "</td>\n\t\t\t</tr>\t\t\n\t\t</table>\n\t<script>\n\tvar x_SaveZarafaIcal{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tYahooWin3Hide();\n\t}\t\n\t\t\n\t\n\tfunction SaveZarafaIcal{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('ZarafaiCalEnable-{$t}').checked){XHR.appendData('ZarafaiCalEnable',1);}else{XHR.appendData('ZarafaiCalEnable',0);}\t\n\t\tXHR.appendData('ZarafaiCalPort',document.getElementById('ZarafaiCalPort-{$t}').value);\n\t\tXHR.appendData('ZarafaiCalBind',document.getElementById('ZarafaiCalBind-{$t}').value);\n\t\tAnimateDiv('div-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveZarafaIcal{$t});\n\t\t}\n\t\t\n\tfunction CheckZarafaiCal(){\n\t\tdocument.getElementById('ZarafaiCalBind-{$t}').disabled=true;\n\t\tdocument.getElementById('ZarafaiCalPort-{$t}').disabled=true;\n\t\tif(document.getElementById('ZarafaiCalEnable-{$t}').checked){\n\t\t\tdocument.getElementById('ZarafaiCalBind-{$t}').disabled=false;\n\t\t\tdocument.getElementById('ZarafaiCalPort-{$t}').disabled=false;\t\t\n\t\t}\n\t}\n\t\n\tCheckZarafaiCal();\n\t\t\n\t\t\n\t</script>\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function params_popup() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $sql = "SELECT hostname,domainname,params FROM postfix_smtp_advrt WHERE zmd5='{$_GET["zmd5"]}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $params = unserialize(base64_decode($ligne["params"])); if (!is_numeric($params["max_msg_per_connection"])) { $params["max_msg_per_connection"] = 5; } if (!is_numeric($params["max_msg_rate"])) { $params["max_msg_rate"] = 600; } if (!is_numeric($params["change_timecode"])) { $params["change_timecode"] = 1; } if (!is_numeric($params["max_smtp_out"])) { $params["max_smtp_out"] = 5; } if (!is_numeric($params["max_cnt_hour"])) { $params["max_cnt_hour"] = 500; } if (!is_numeric($params["wait_xs_per_message"])) { $params["wait_xs_per_message"] = 0; } if (!is_numeric($params["max_msg_rate_timeout"])) { $params["max_msg_rate_timeout"] = 300; } if (!is_numeric($params["CNX_421"])) { $params["CNX_421"] = 30; } if (!is_numeric($params["msgs_ttl"])) { $params["msgs_ttl"] = 300; } if (!is_numeric($params["min_subqueue_msgs"])) { $params["min_subqueue_msgs"] = 5; } if (!is_numeric($params["min_subqueue_msgs_ttl"])) { $params["min_subqueue_msgs_ttl"] = 30; } $lockMX = 0; if ($params["smtp_authenticate"] == 1) { if ($params["AUTH-SMTP"] != null) { $lockMX = 1; } } if ($params["bounce_from"] == null) { $params["bounce_from"] = "MAILER-DAEMON"; } $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $main = new maincf_multi($_GET["hostname"]); $ipaddr = $main->ip_addr; if (!isset($params["bind_address"])) { $params["bind_address"] = $main->ip_addr; } $nets = Field_array_Hash($ips, "bind_address", $params["bind_address"], "style:font-size:16px;padding:3px"); $arrayMXS = ResolveMXDomain($ligne["domainname"]); $arrayMXS[null] = "{automatic}"; $ForceMX = Field_array_Hash($arrayMXS, "ForceMX", $params["ForceMX"], "style:font-size:16px;padding:3px"); $sql = "SELECT hostname FROM postfix_smtp_advrt WHERE domainname='{$ligne["domainname"]}' ORDER BY hostname"; $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne421 = mysql_fetch_assoc($results)) { if ($ligne421["hostname"] == $ligne["hostname"]) { continue; } $ligne421AR[$ligne421["hostname"]] = $ligne421["hostname"]; } $ligne421AR[null] = "{select}"; $MoveTo421Field = Field_array_Hash($ligne421AR, "CNX_421_HOST", $params["CNX_421_HOST"], "style:font-size:14px;padding:3px"); $html = "\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{bind_address}:</td>\n\t\t<td style='font-size:14px'>{$nets} {ipaddr}</td>\n\t\t<td width=1%></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{debug}:</td>\n\t\t<td style='font-size:14px'>" . Field_checkbox("debug_parameters", 1, $params["debug_parameters"]) . "</td>\n\t\t<td>" . help_icon("{smtp_adv_debug_explain}") . "</td>\n\t</tr>\t\n\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{forceMX}:</td>\n\t\t<td style='font-size:14px'>{$ForceMX}</td>\n\t\t<td width=1%>" . help_icon("{smtp_adv_forcemx_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{authenticate}:</td>\n\t\t<td style='font-size:14px'>" . Field_checkbox("smtp_authenticate", 1, $params["smtp_authenticate"]) . " \n\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$page}?js-authenticate=yes&hostname={$_GET["hostname"]}&ou={$_GET["ou"]}&zmd5={$_GET["zmd5"]}')\" style=\"font-size:13px;text-decoration:underline\">{parameters}</a>\n\t\t</td>\n\t\t<td width=1%>" . help_icon("{smtpadv_authenticate_explain}") . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{max_processes}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("max_smtp_out", $params["max_smtp_out"], "font-size:14px;width:65px") . " {processes}</td>\n\t\t<td width=1%></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{min_subqueue_msgs}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("min_subqueue_msgs", $params["min_subqueue_msgs"], "font-size:14px;width:65px") . " {messages}</td>\n\t\t<td width=1%>" . help_icon("{min_subqueue_msgs_explain}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{min_subqueue_msgs_ttl}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("min_subqueue_msgs_ttl", $params["min_subqueue_msgs_ttl"], "font-size:14px;width:65px") . " {seconds}</td>\n\t\t<td width=1%>" . help_icon("{min_subqueue_msgs_ttl_explain}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{max_msg_per_connection}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("max_msg_per_connection", $params["max_msg_per_connection"], "font-size:14px;width:65px") . " {messages}</td>\n\t\t<td width=1%></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{wait_xs_per_message}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("wait_xs_per_message", $params["wait_xs_per_message"], "font-size:14px;width:65px") . " {seconds}</td>\n\t\t<td width=1%>" . help_icon("{wait_xs_per_message_explain}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{max_cnt_hour}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("max_cnt_hour", $params["max_cnt_hour"], "font-size:14px;width:65px") . " {connections}/{hour}</td>\n\t\t<td width=1%></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{aiguil_max_msg_rate}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("max_msg_rate", $params["max_msg_rate"], "font-size:14px;width:65px") . " {seconds}</td>\n\t\t<td>" . help_icon("{aiguil_max_msg_rate_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{max_msg_rate_timeout}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("max_msg_rate_timeout", $params["max_msg_rate_timeout"], "font-size:14px;width:65px") . " {seconds}</td>\n\t\t<td width=1%></td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{CNX_421}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("CNX_421", $params["CNX_421"], "font-size:14px;width:65px") . " {minutes}</td>\n\t\t<td>" . help_icon("{CNX_421_EXPLAIN}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{CNX_421_MOVE_TO}:</td>\n\t\t<td style='font-size:14px'>" . Field_checkbox("CNX_421_MOVE", 1, $params["CNX_421_MOVE"], "Check421Move()") . "</td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{CNX_421_MOVE_TO_HOST}:</td>\n\t\t<td style='font-size:14px'>{$MoveTo421Field}</td>\n\t\t<td>" . help_icon("{CNX_421_MOVE_TO_HOST_EXPLAIN}") . "</td>\n\t</tr>\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{msgs_ttl}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("msgs_ttl", $params["msgs_ttl"], "font-size:14px;width:65px") . " {minutes}</td>\n\t\t<td>" . help_icon("{msgs_ttl_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{bounce_use_instance}:</td>\n\t\t<td style='font-size:14px'>" . Field_checkbox("bounce_use_instance", 1, $params["bounce_use_instance"]) . "</td>\n\t\t<td>" . help_icon("{bounce_use_instance_explain}") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{bounce_from}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("bounce_from", $params["bounce_from"], "font-size:14px;width:220px") . "</td>\n\t\t<td>" . help_icon("{bounce_from_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{bounce_to}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("bounce_to", $params["bounce_to"], "font-size:14px;width:220px") . "</td>\n\t\t<td>" . help_icon("{bounce_to_explain}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{change_timecode}:</td>\n\t\t<td style='font-size:14px'>" . Field_checkbox("change_timecode", 1, $params["change_timecode"]) . "</td>\n\t\t<td>" . help_icon("{change_timecode_explain}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SavePostfixAdvRouting()", 14) . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\t\n<script>\n\tvar x_SavePostfixAdvRouting= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tYahooWinBrowseHide();\n\t\tFlexReloadAdvPostRout();\n\t}\n\t\nfunction SavePostfixAdvRouting(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\tXHR.appendData('ou','{$_GET["ou"]}');\n\tXHR.appendData('zmd5','{$_GET["zmd5"]}');\n\tXHR.appendData('max_smtp_out',document.getElementById('max_smtp_out').value);\n\tXHR.appendData('max_msg_per_connection',document.getElementById('max_msg_per_connection').value);\n\tXHR.appendData('bind_address',document.getElementById('bind_address').value);\n\tXHR.appendData('max_cnt_hour',document.getElementById('max_cnt_hour').value);\n\tXHR.appendData('CNX_421',document.getElementById('CNX_421').value);\n\tXHR.appendData('msgs_ttl',document.getElementById('msgs_ttl').value);\n\tXHR.appendData('bounce_from',document.getElementById('bounce_from').value);\n\tXHR.appendData('bounce_to',document.getElementById('bounce_to').value);\n\tXHR.appendData('max_msg_rate',document.getElementById('max_msg_rate').value);\n\tXHR.appendData('min_subqueue_msgs_ttl',document.getElementById('min_subqueue_msgs_ttl').value);\n\tXHR.appendData('max_msg_rate_timeout',document.getElementById('max_msg_rate_timeout').value);\n\tXHR.appendData('min_subqueue_msgs',document.getElementById('min_subqueue_msgs').value);\n\tXHR.appendData('ForceMX',document.getElementById('ForceMX').value);\n\tXHR.appendData('CNX_421_HOST',document.getElementById('CNX_421_HOST').value);\n\tif(document.getElementById('change_timecode').checked){XHR.appendData('change_timecode',1);}else{XHR.appendData('change_timecode',0);}\n\tif(document.getElementById('CNX_421_MOVE').checked){XHR.appendData('CNX_421_MOVE',1);}else{XHR.appendData('CNX_421_MOVE',0);}\n\tif(document.getElementById('debug_parameters').checked){XHR.appendData('debug_parameters',1);}else{XHR.appendData('debug_parameters',0);}\n\tif(document.getElementById('bounce_use_instance').checked){XHR.appendData('bounce_use_instance',1);}else{XHR.appendData('bounce_use_instance',0);}\n\tif(document.getElementById('smtp_authenticate').checked){XHR.appendData('smtp_authenticate',1);}else{XHR.appendData('smtp_authenticate',0);}\n\t\n\t\n\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',x_SavePostfixAdvRouting);\t\n\t}\n\t\n\tfunction Check421Move(){\n\t\tdocument.getElementById('CNX_421_HOST').disabled=true;\n\t\tif(document.getElementById('CNX_421_MOVE').checked){document.getElementById('CNX_421_HOST').disabled=false;}\n\t}\n\t\n\tfunction LockMXFields(){\n\t\tvar lock={$lockMX};\n\t\tif(lock==1){\n\t\t\tdocument.getElementById('ForceMX').disabled=true;\n\t\t}\n\t}\nLockMXFields();\t\nCheck421Move();\t\n</script>\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function LDAP_CONFIG_SETTINGS() { $sock = new sockets(); $ini = new Bs_IniHandler(); $LdapDBSetCachesize = $sock->GET_INFO("LdapDBSetCachesize"); $LdapDBSCachesize = $sock->GET_INFO("LdapDBCachesize"); if ($LdapDBSetCachesize == null) { $LdapDBSetCachesize = 5120000; } if ($LdapDBSCachesize == null) { $LdapDBSCachesize = 1000; } $LdapListenIPAddr = $sock->GET_INFO('LdapListenIPAddr'); $dbstat = explode("\n", $sock->getFrameWork("cmd.php?LdapdbStat=yes")); $LdapdbSize = $sock->getFrameWork('cmd.php?LdapdbSize=yes'); if (preg_match('#(.+?)\\s+#', $LdapdbSize, $re)) { $LdapdbSize = $re[1]; } $net = new networking(); $nets = $net->ALL_IPS_GET_ARRAY(); $nets = Field_array_Hash($nets, 'LdapListenIPAddr', $LdapListenIPAddr); $form_network = "\n\t<H3>{antispam_engine_text}</H3> \n\t<table style='width:100%' class=table_form>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{ListenAddress}:</td>\n\t\t\t<td><strong style='font-size:11px' nowrap>{$nets}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{allowanonymouslogin}:</td>\n\t\t\t<td><strong style='font-size:11px' nowrap>" . Field_checkbox("LdapAllowAnonymous", 1, $sock->GET_INFO('LdapAllowAnonymous')) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{remote_addressbook_text}:</td>\n\t\t\t<td><strong style='font-size:11px' nowrap>" . Field_checkbox("EnableRemoteAddressBook", 1, $sock->GET_INFO('EnableRemoteAddressBook')) . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:ParseFormLDAP();\" value='{edit} »'></td>\n\t\t</tr>\t\n\t</table>\n\t"; //Program version 4.6 doesn't match environment version 4.7 $form = "\n\t\t<table style='width:100%' class=table_form>\n\t\t<tr>\n\t\t\t<td class=legend>{set_cachesize}:</td>\n\t\t\t<td>" . Field_text('set_cachesize', $LdapDBSetCachesizeMo, 'width:25px') . "M </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{ldap_cache_size}:</td>\n\t\t\t<td>" . Field_text('cachesize', $LdapDBSCachesize, 'width:55px') . " {entries}</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:ParseFormLDAP();\" value='{edit} »'></td>\n\t\t</tr>\t\n\t\t</table>\n\t\t"; $html = "<H1>{ldap_configure_bdbd}</H1>\n<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><img src='img/ldap-performances-128.png'><hr>{$return}</td>\n\t\t\n\t\t<td valign='top'>\n\t\t<div id='cachesizediv'>\n\t\t{$form_network}\n\t\t\t<H3>{databases_status}</h3>\n\t\t\t<p class=caption>{set_cachesize_text}</p>\n\t\t\t\t{$db}\n\t\t\t<hr>\n\t\t\t\t<H3>{ldap_configure_bdbd}</H3>\n\t\t\t\t{$form}\n\t\t </div>\n\t\t</td>\n\t</tr>\n</table>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html, 'mysql.index.php'); }
function daemons() { $ci = new cicap(); $page = CurrentPageName(); $sock = new sockets(); $EnableSquidGuardInCiCAP = $sock->GET_INFO("EnableSquidGuardInCiCAP"); $EnableUfdbGuard = intval($sock->EnableUfdbGuard()); $EnableClamavInCiCap = $sock->GET_INFO("EnableClamavInCiCap"); $MaxCICAPWorkTimeMin = $sock->GET_INFO("MaxCICAPWorkTimeMin"); $MaxCICAPWorkSize = $sock->GET_INFO("MaxCICAPWorkSize"); if (!is_numeric($MaxCICAPWorkTimeMin)) { $MaxCICAPWorkTimeMin = 1440; } if (!is_numeric($MaxCICAPWorkSize)) { $MaxCICAPWorkSize = 5000; } $CICAPListenAddress = $sock->GET_INFO("CICAPListenAddress"); if (!is_numeric($EnableSquidGuardInCiCAP)) { $EnableSquidGuardInCiCAP = 0; } if (!is_numeric($EnableClamavInCiCap)) { $EnableClamavInCiCap = 1; } if ($CICAPListenAddress == null) { $CICAPListenAddress = "127.0.0.1"; } $users = new usersMenus(); if (!$users->SQUIDGUARD_INSTALLED) { $disableSquiduard = true; $EnableSquidGuardInCiCAP = 0; } if ($users->APP_UFDBGUARD_INSTALLED) { if ($EnableUfdbGuard == 1) { $disableSquiduard = true; $EnableSquidGuardInCiCAP = 0; } } if ($disableSquiduard) { $DisableSquidGuardCheckCicap = "DisableSquidGuardCheckCicap();"; } $tcp = new networking(); $ips = $tcp->ALL_IPS_GET_ARRAY(); $notifyVirHTTPServer = false; if ($ci->main_array["CONF"]["ViralatorMode"] == 1) { if (preg_match('#https://(.*?)/exec#', $ci->main_array["CONF"]["VirHTTPServer"], $re)) { if (trim($re[1]) == null) { $notifyVirHTTPServer = true; } if (trim($re[1]) == "127.0.0.1") { $notifyVirHTTPServer = true; } if (trim($re[1]) == "localhost") { $notifyVirHTTPServer = true; } } } if ($notifyVirHTTPServer == true) { $color = "color:#d32d2d;font-weight:bolder"; } for ($i = 1; $i < 13; $i++) { $f[$i] = $i; } $html = "\n\t\n\t<div style='font-size:26px;margin-bottom:20px'>{daemon_settings_text}</div>\n\t\n\t<input type='hidden' id='EnableClamavInCiCapCheck' value='{$EnableClamavInCiCap}'>\n\t<div id='ffmcc1' style='width:95%' class=form>\n\t<table style='width:100%'>\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{listen_address}:</td>\n\t\t<td style='font-size:22px'>" . Field_array_Hash($ips, 'CICAPListenAddress', $CICAPListenAddress, null, null, 0, 'font-size:22px;padding:3px') . "</td>\n\t\t<td></td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{Timeout}", "{Timeout_text}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text('Timeout', $ci->main_array["CONF"]["Timeout"], 'width:150px;font-size:22px;padding:3px') . " {seconds}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{MaxKeepAliveRequests}", "{MaxKeepAliveRequests_text}") . ":</td>\n\t\t<td>" . Field_text('MaxKeepAliveRequests', $ci->main_array["CONF"]["MaxKeepAliveRequests"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{KeepAliveTimeout}", "{KeepAliveTimeout_text}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text('KeepAliveTimeout', $ci->main_array["CONF"]["KeepAliveTimeout"], 'width:150px;font-size:22px;padding:3px') . " {seconds}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{MaxServers}", "{MaxServers_text}") . ":</td>\n\t\t<td>" . Field_text('MaxServers', $ci->main_array["CONF"]["MaxServers"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{MinSpareThreads}", "{MinSpareThreads_text}") . ":</td>\n\t\t<td>" . Field_text('MinSpareThreads', $ci->main_array["CONF"]["MinSpareThreads"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{MaxSpareThreads}", "{MaxSpareThreads_text}") . ":</td>\n\t\t<td>" . Field_text('MaxSpareThreads', $ci->main_array["CONF"]["MaxSpareThreads"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{ThreadsPerChild}", "{ThreadsPerChild_text}") . ":</td>\n\t\t<td>" . Field_text('ThreadsPerChild', $ci->main_array["CONF"]["ThreadsPerChild"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{MaxRequestsPerChild}", "{MaxRequestsPerChild_text}") . ":</td>\n\t\t<td>" . Field_text('MaxRequestsPerChild', $ci->main_array["CONF"]["MaxRequestsPerChild"], 'width:150px;font-size:22px;padding:3px') . " </td>\n\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{debug_mode}", "{log level_text}") . ":</td>\n\t\t<td>" . Field_array_Hash($f, "DebugLevel", $ci->main_array["CONF"]["DebugLevel"], null, null, 0, 'font-size:22px;padding:3px') . " </td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=3> </td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 style='border-top:1px solid #CCCCCC'> </td>\n\t</tr>\n\n\t\t\t\t\n\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{max_time_in_tmp}", "{max_time_in_tmp_explain}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("MaxCICAPWorkTimeMin", $MaxCICAPWorkTimeMin, 'width:150px;font-size:22px;padding:3px') . " {minutes}</td>\n\t</tr>\t\t\t\t\n\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{max_tempdir_size}", "{max_tempdir_size_explain}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("MaxCICAPWorkSize", $MaxCICAPWorkSize, 'width:150px;font-size:22px;padding:3px') . " MB</td>\n\t</tr>\t\t\t\t\t\n\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=3> </td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 style='border-top:1px solid #CCCCCC'> </td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:22px'>" . texttooltip("{ViralatorMode}", "{ViralatorMode_text}") . ":</td>\n\t\t<td>" . Field_checkbox_design("ViralatorMode", 1, $ci->main_array["CONF"]["ViralatorMode"], "EnableDisableViralatorMode()") . "</td>\n\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{VirSaveDir}", "{VirSaveDir_text}") . ":</td>\n\t\t<td>" . Field_text('VirSaveDir', $ci->main_array["CONF"]["VirSaveDir"], 'width:490px;font-size:22px;padding:3px') . " </td>\n\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='{$color};font-size:22px'>" . texttooltip("{VirHTTPServer}", "{VirHTTPServer_text}") . ":</td>\n\t\t<td>" . Field_text('VirHTTPServer', $ci->main_array["CONF"]["VirHTTPServer"], 'width:290px;font-size:22px;padding:3px') . " </td>\n\t</tr>\n\t<tr>\t\n\t\t<td class=legend>{example}:</td>\n\t\t<td colspan=2><strong><a href='https://{$_SERVER['SERVER_NAME']}/exec.cicap.php?usename=%f&remove=1&file='>https://{$_SERVER['SERVER_NAME']}/exec.cicap.php?usename=%f&remove=1&file=</a></strong></td>\n\t</tr>\t\n\t\t\t\n\t\n\n\t<tr>\n\t\t<td colspan=3 align='right'>\n\t\t<hr>\n\t\t\t" . button("{apply}", "SaveIcapDaemonSet()", 26) . "\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<script>\nvar x_SaveIcapDaemonSet=function(obj){\n var tempvalue=obj.responseText;\n\t if(tempvalue.length>3){alert(tempvalue);}\n\t RefreshTab('main_config_cicap');\n\t\n\t}\t\n\t\n\tfunction SaveIcapDaemonSet(){\n\t\tvar XHR = new XHRConnection();\n\t XHR.appendData('Timeout',document.getElementById('Timeout').value);\n\t XHR.appendData('MaxKeepAliveRequests',document.getElementById('MaxKeepAliveRequests').value);\n\t XHR.appendData('KeepAliveTimeout',document.getElementById('KeepAliveTimeout').value);\n\t \n\t XHR.appendData('MaxServers',document.getElementById('MaxServers').value);\n\t XHR.appendData('MinSpareThreads',document.getElementById('MinSpareThreads').value);\n\t XHR.appendData('ThreadsPerChild',document.getElementById('ThreadsPerChild').value);\n\t XHR.appendData('MaxRequestsPerChild',document.getElementById('MaxRequestsPerChild').value);\n\t XHR.appendData('VirSaveDir',document.getElementById('VirSaveDir').value);\n\t XHR.appendData('VirHTTPServer',document.getElementById('VirHTTPServer').value);\n\t XHR.appendData('DebugLevel',document.getElementById('DebugLevel').value);\n\t XHR.appendData('CICAPListenAddress',document.getElementById('CICAPListenAddress').value);\n\t if(document.getElementById('ViralatorMode').checked){XHR.appendData('ViralatorMode',1);}else{XHR.appendData('ViralatorMode',0);}\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveIcapDaemonSet);\n\t}\n\t\n\tfunction EnableDisableViralatorMode(){\n\t\t document.getElementById('VirSaveDir').disabled=true;\n\t document.getElementById('VirHTTPServer').disabled=true;\n\t if(document.getElementById('EnableClamavInCiCapCheck').value==0){return;}\n\t \n\t \n\t if(document.getElementById('ViralatorMode').checked){\n\t document.getElementById('VirSaveDir').disabled=false;\n\t document.getElementById('VirHTTPServer').disabled=false;\n\t\t }\n\t\n\t}\n\t\n\tfunction DisableSquidGuardCheckCicap(){\n\t \tif(document.getElementById('EnableSquidGuardInCiCAP')){\n\t \t\tdocument.getElementById('EnableSquidGuardInCiCAP').checked=false;\n\t \t\tdocument.getElementById('EnableSquidGuardInCiCAP').disabled=true;\n\t\t}\n\t}\n\t\n\tEnableDisableViralatorMode();\n\t{$DisableSquidGuardCheckCicap}\n\t\n</script>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function parameters_client(){ $sock=new sockets(); $tpl=new templates(); $page=CurrentPageName(); $RemoteUfdbCat=intval($sock->GET_INFO("RemoteUfdbCat")); $ufdbCatPort=intval($sock->GET_INFO("ufdbCatPort")); $ufdbCatInterface=$sock->GET_INFO("ufdbCatInterface"); $EnableLocalUfdbCatService=intval($sock->GET_INFO("EnableLocalUfdbCatService")); if($ufdbCatPort==0){$ufdbCatPort=3978;} $p0=Paragraphe_switch_img("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{use_local_categories_services_explain_warn}</strong>", "EnableLocalUfdbCatService",$EnableLocalUfdbCatService,null,800,"EnableLocalUfdbCatServiceCheck()" ); $p1=Paragraphe_switch_img("{use_remote_categories_services}", "{use_remote_categories_services_explain}", "RemoteUfdbCat",$RemoteUfdbCat,null,800 ); $ip=new networking(); $ips=$ip->ALL_IPS_GET_ARRAY(); $ufdbCatInterface=$sock->GET_INFO("ufdbCatInterface"); $ufdbCatPort=intval($sock->GET_INFO("ufdbCatPort")); $UfdbCatThreads=intval($sock->GET_INFO("UfdbCatThreads")); unset($ips["127.0.0.1"]); for($i=1;$i<65;$i++){ $threads[$i]=$i; } if($UfdbCatThreads==0){$UfdbCatThreads=4;} if($ufdbCatPort==0){$ufdbCatPort=3978;} $ips[null]="{none}"; reset($ips); $t=time(); $html=" <div style='width:98%' class=form> $p0 <table style='width:100%'>". Field_list_table("ufdbCatInterface1", "{listen_address}", $ufdbCatInterface,22,$ips). Field_text_table("ufdbCatPort1", "{listen_port}", $ufdbCatPort,22,null,120). Field_list_table("UfdbCatThreads1", "{threads}", $UfdbCatThreads,22,$threads)."</table> <div id='design1-$t'>$p1 <table style='width:100%'> ". Field_text_table("ufdbCatInterface", "{remote_address}", $ufdbCatInterface,22,null,230). Field_text_table("ufdbCatPort", "{listen_port}", $ufdbCatPort,22,null,120). "</table> </div>"." <table style='width:100%'>". Field_button_table_autonome("{apply}","Save$t()",32)." </table> </div> <script> var xSave$t=function (obj) { RefreshTab('main_ufdbguard_config'); Loadjs('squid.reconfigure.simple.php'); } function Save$t(){ var XHR = new XHRConnection(); var EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value; if(EnableLocalUfdbCatService==0){ XHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface').value); XHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort').value); XHR.appendData('RemoteUfdbCat',document.getElementById('RemoteUfdbCat').value); }else{ XHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface1').value); XHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort1').value); XHR.appendData('UfdbCatThreads',document.getElementById('UfdbCatThreads1').value); } XHR.appendData('EnableLocalUfdbCatService',document.getElementById('EnableLocalUfdbCatService').value); XHR.sendAndLoad('$page', 'POST',xSave$t); } function EnableLocalUfdbCatServiceCheck(){ var EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value; document.getElementById('ufdbCatInterface').disabled=false; document.getElementById('ufdbCatPort').disabled=false; document.getElementById('RemoteUfdbCat').disabled=false; document.getElementById('ufdbCatInterface1').disabled=true; document.getElementById('ufdbCatPort1').disabled=true; document.getElementById('UfdbCatThreads1').disabled=true; document.getElementById('design1-$t').style.visibility='visible'; if(EnableLocalUfdbCatService==1){ document.getElementById('RemoteUfdbCat').disabled=true; document.getElementById('ufdbCatInterface').disabled=true; document.getElementById('ufdbCatPort').disabled=true; document.getElementById('RemoteUfdbCat').disabled=true; document.getElementById('ufdbCatInterface1').disabled=false; document.getElementById('ufdbCatPort1').disabled=false; document.getElementById('UfdbCatThreads1').disabled=false; document.getElementById('design1-$t').style.visibility='hidden'; } CheckBoxDesignHidden(); } EnableLocalUfdbCatServiceCheck(); </script> "; echo $tpl->_ENGINE_parse_body($html); }
function build() { $sock = new sockets(); $unix = new unix(); $nohup = $unix->find_program("nohup"); $php5 = $unix->LOCATE_PHP5_BIN(); $q = new mysql(); $DisablePowerDnsManagement = $sock->GET_INFO("DisablePowerDnsManagement"); if (!is_numeric($DisablePowerDnsManagement)) { $DisablePowerDnsManagement = 0; } if ($DisablePowerDnsManagement == 1) { return; } @mkdir("/etc/powerdns/pdns.d", 0755, true); $PowerDNSLogLevel = $sock->GET_INFO("PowerDNSLogLevel"); $PowerDNSMySQLEngine = $sock->GET_INFO("PowerDNSMySQLEngine"); $PowerUseGreenSQL = $sock->GET_INFO("PowerUseGreenSQL"); $PowerDisableDisplayVersion = $sock->GET_INFO("PowerDisableDisplayVersion"); $PowerChroot = $sock->GET_INFO("PowerChroot"); $PowerActHasMaster = $sock->GET_INFO("PowerActHasMaster"); $PowerDNSDNSSEC = $sock->GET_INFO("PowerDNSDNSSEC"); $PowerDNSDisableLDAP = $sock->GET_INFO("PowerDNSDisableLDAP"); $PowerDNSPublicMode = $sock->GET_INFO("PowerDNSPublicMode"); $PowerActAsSlave = $sock->GET_INFO("PowerActAsSlave"); $PdnsNoWriteConf = $sock->GET_INFO("PdnsNoWriteConf"); $PowerSkipCname = $sock->GET_INFO("PowerSkipCname"); $PDSNInUfdb = $sock->GET_INFO("PDSNInUfdb"); $SquidActHasReverse = $sock->GET_INFO("SquidActHasReverse"); $EnableUfdbGuard = $sock->GET_INFO("EnableUfdbGuard"); $PowerDNSMySQLType = $sock->GET_INFO("PowerDNSMySQLType"); $PowerDNSMySQLRemotePort = $sock->GET_INFO("PowerDNSMySQLRemotePort"); $EnablePDNSRecurseRestrict = $sock->GET_INFO("EnablePDNSRecurseRestrict"); $PdnsHotSpot = $sock->GET_INFO("PdnsHotSpot"); $PowerDNSMySQLRemoteServer = $sock->GET_INFO("PowerDNSMySQLRemoteServer"); $PdnsHotSpot = $sock->GET_INFO("PdnsHotSpot"); $PowerDNSMySQLRemoteAdmin = $sock->GET_INFO("PowerDNSMySQLRemoteAdmin"); $PowerDNSMySQLRemotePassw = $sock->GET_INFO("PowerDNSMySQLRemotePassw"); if (!is_numeric($PowerDNSLogLevel)) { $PowerDNSLogLevel = 1; } if (!is_numeric($PowerDNSMySQLEngine)) { $PowerDNSMySQLEngine = 1; } if (!is_numeric($PowerUseGreenSQL)) { $PowerUseGreenSQL = 0; } if (!is_numeric($PowerDisableDisplayVersion)) { $PowerDisableDisplayVersion = 0; } if (!is_numeric($PowerChroot)) { $PowerChroot = 0; } if (!is_numeric($PowerActHasMaster)) { $PowerActHasMaster = 0; } if (!is_numeric($PowerDNSDNSSEC)) { $PowerDNSDNSSEC = 0; } if (!is_numeric($PowerDNSDisableLDAP)) { $PowerDNSDisableLDAP = 1; } if (!is_numeric($PowerDNSPublicMode)) { $PowerDNSPublicMode = 0; } if (!is_numeric($PowerActAsSlave)) { $PowerActAsSlave = 0; } if (!is_numeric($PdnsNoWriteConf)) { $PdnsNoWriteConf = 0; } if (!is_numeric($PowerSkipCname)) { $PowerSkipCname = 0; } if (!is_numeric($PDSNInUfdb)) { $PDSNInUfdb = 0; } if (!is_numeric($SquidActHasReverse)) { $SquidActHasReverse = 0; } if (!is_numeric($EnableUfdbGuard)) { $EnableUfdbGuard = 0; } if (!is_numeric($PowerDNSMySQLType)) { $PowerDNSMySQLType = 1; } if (!is_numeric($PowerDNSMySQLRemotePort)) { $PowerDNSMySQLRemotePort = 3306; } if (!is_numeric($EnablePDNSRecurseRestrict)) { $EnablePDNSRecurseRestrict = 0; } $LaunchPipe = 0; $pipe = ''; if ($SquidActHasReverse == 1) { $PDSNInUfdb = 0; } if ($EnableUfdbGuard == 0) { $PDSNInUfdb = 0; } if (!is_file("/usr/bin/ufdbgclient")) { $PDSNInUfdb = 0; } $q = new mysql(); $database_admin = $q->mysql_admin; $database_password = $q->mysql_password; if ($database_admin == null) { $database_admin = 'root'; } if ($PDSNInUfdb == 1) { $LaunchPipe = 1; } if ($PdnsHotSpot == 1) { $LaunchPipe = 1; } if ($LaunchPipe == 1) { $launch[] = 'pipe'; } $recursor = "127.0.0.1:1553"; $recursor_bin = $unix->find_program("pdns_recursor"); if (!is_file($recursor_bin)) { $resolv = new resolv_conf(); $IpClass = new IP(); $rr = array(); if ($resolv->MainArray["DNS1"] == "127.0.0.1") { $resolv->MainArray["DNS1"] = null; } if ($resolv->MainArray["DNS2"] == "127.0.0.1") { $resolv->MainArray["DNS2"] = null; } if ($resolv->MainArray["DNS3"] == "127.0.0.1") { $resolv->MainArray["DNS3"] = null; } if (!$IpClass->isValid($resolv->MainArray["DNS1"])) { $resolv->MainArray["DNS1"] = null; } if (!$IpClass->isValid($resolv->MainArray["DNS2"])) { $resolv->MainArray["DNS2"] = null; } if (!$IpClass->isValid($resolv->MainArray["DNS3"])) { $resolv->MainArray["DNS3"] = null; } if ($resolv->MainArray["DNS1"] != null) { $rr[] = $resolv->MainArray["DNS1"]; } if ($resolv->MainArray["DNS2"] != null) { $rr[] = $resolv->MainArray["DNS2"]; } if ($resolv->MainArray["DNS3"] != null) { $rr[] = $resolv->MainArray["DNS3"]; } $recursor = $rr[0]; } // PowerSkipCname: Do not perform CNAME indirection for each query if ($PdnsNoWriteConf == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} PdnsNoWriteConf is enabled, skip the config and aborting pdns.conf\n"; } return; } $pdnssec_bin = $unix->find_program("pdnssec"); if (!is_file($pdnssec_bin)) { $PowerDNSDNSSEC = 0; } $PowerDNSListenAddrDefault = true; $cdirlist[] = '127.0.0.0/8'; $cdirlist[] = '127.0.0.1'; $PowerDNSListenAddr = $sock->getFrameWork("PowerDNSListenAddr"); $t = array(); $ipA = explode("\n", $PowerDNSListenAddr); while (list($line2, $ip) = each($ipA)) { if (trim($ip) == null) { continue; } if (!$unix->isIPAddress($ip)) { continue; } $t[$ip] = $ip; } if (count($t) == 0) { $ips = new networking(); $ipz = $ips->ALL_IPS_GET_ARRAY(); while (list($ip, $line2) = each($ipz)) { $t[$ip] = $ip; } } $LOCAL_ADDRESSES = array(); unset($t["127.0.0.1"]); while (list($a, $b) = each($t)) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} listen: {$a}\n"; } $LOCAL_ADDRESSES[] = $a; $cdirlist[] = $a; } $iplistV6 = array(); $RecursoriplistV6 = array(); $RecursoripAllowFrom = array(); $PowerDNSListenAddrV6 = explode("\n", $sock->GET_INFO("PowerDNSListenAddrV6")); while (list($field, $value) = each($PowerDNSListenAddrV6)) { if (trim($value) == null) { continue; } $iplistV6[] = $value; $RecursoriplistV6[] = "[" . $value . "]"; $RecursoripAllowFrom[] = $value; } $launch[] = 'gmysql'; if ($PowerDNSDisableLDAP == 0) { $launch[] = 'ldap'; } $f = array(); if ($EnablePDNSRecurseRestrict == 1) { $t = array(); $sql = "SELECT * FROM pdns_restricts"; $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne = mysql_fetch_assoc($results)) { $addr = trim($ligne["address"]); if ($addr == null) { continue; } $t[] = $addr; } if (count($t) > 0) { $f[] = "allow-recursion=" . @implode(",", $t); } } $f[] = "#allow-recursion=0.0.0.0/0 "; $f[] = "#allow-recursion-override=on"; $f[] = "cache-ttl=20"; if ($PowerChroot == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} is chrooted\n"; } $f[] = "chroot=./"; } if ($PowerActHasMaster == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Act has master\n"; } $f[] = "master=yes"; } if ($PowerActAsSlave == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Act has Slave\n"; } $f[] = "slave=yes"; } $f[] = "config-dir=/etc/powerdns"; $f[] = "# config-name="; $f[] = "# control-console=no"; $f[] = "daemon=yes"; $f[] = "# default-soa-name=a.misconfigured.powerdns.server"; $f[] = "disable-axfr=no"; $f[] = "# disable-tcp=no"; $f[] = "# distributor-threads=3"; $f[] = "# fancy-records=no"; $f[] = "guardian=yes"; $f[] = "launch=" . @implode(",", $launch); if ($PDSNInUfdb == 1) { @chmod("/usr/share/artica-postfix/exec.pdns.pipe.php", 0777); $f[] = "pipe-command=/usr/share/artica-postfix/exec.pdns.pipe.php"; $f[] = "pipebackend-abi-version=2"; $f[] = "distributor-threads=2"; } if ($PdnsHotSpot == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} HotSpot engine...\n"; } @chmod("/usr/share/artica-postfix/exec.pdns.pipe.php", 0777); $f[] = "pipe-command=/usr/share/artica-postfix/exec.pdns.pipe.php"; $f[] = "pipebackend-abi-version=2"; $f[] = "distributor-threads=2"; } //$f[]="lazy-recursion=yes"; $f[] = "#local-address=0.0.0.0"; $f[] = "local-address=" . @implode(",", $LOCAL_ADDRESSES); if (count($iplistV6) > 0) { $iplistV6[] = "::1"; $f[] = "local-ipv6=" . @implode(",", $iplistV6); } //$f[]="query-local-address6=::1"; $f[] = "local-port=53"; $f[] = "log-dns-details=on"; //$f[]="logfile=/var/log/pdns.log"; $f[] = "# logging-facility="; $f[] = "loglevel={$PowerDNSLogLevel}"; $f[] = "# max-queue-length=5000"; $f[] = "# max-tcp-connections=10"; $MODULES_DIR = MODULES_DIR(); if ($MODULES_DIR != null) { $f[] = "module-dir={$MODULES_DIR}"; } $f[] = "# negquery-cache-ttl=60"; $f[] = "out-of-zone-additional-processing=yes"; $f[] = "# query-cache-ttl=20"; $f[] = "query-logging=yes"; $f[] = "# queue-limit=1500"; $f[] = "# receiver-threads=1"; $f[] = "# recursive-cache-ttl=10"; $f[] = "recursor={$recursor}"; // $f[] = "#setgid=pdns"; $f[] = "#setuid=pdns"; //$f[]="skip-cname=yes"; $f[] = "# slave-cycle-interval=60"; $f[] = "# smtpredirector=a.misconfigured.powerdns.smtp.server"; $f[] = "# soa-minimum-ttl=3600"; $f[] = "# soa-refresh-default=10800"; $f[] = "# soa-retry-default=3600"; $f[] = "# soa-expire-default=604800"; $f[] = "# soa-serial-offset=0"; $f[] = "socket-dir=/var/run/pdns"; $f[] = "# strict-rfc-axfrs=no"; $f[] = "# urlredirector=127.0.0.1"; //$f[]="use-logfile=yes"; $f[] = "webserver=yes"; $f[] = "webserver-address=127.0.0.1"; $f[] = "webserver-password="******"webserver-port=8081"; $f[] = "webserver-print-arguments=no"; //if PowerSkipCname=0 then $f[]="skip-cname=no') else $f[]="skip-cname=yes"; $f[] = "# wildcard-url=no"; $f[] = "# wildcards="; if ($PowerDisableDisplayVersion == 0) { $f[] = "version-string=powerdns"; } else { $f[] = "version-string=nope"; } if ($PowerDNSMySQLType == 1) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} MySQL /var/run/mysqld/mysqld.sock@{$database_admin}\n"; } $G[] = "gmysql-socket=/var/run/mysqld/mysqld.sock"; $G[] = "gmysql-user={$database_admin}"; if ($database_password != null) { $G[] = "gmysql-password={$database_password}"; } $G[] = "gmysql-dbname=powerdns"; shell_exec("{$nohup} {$php5} /usr/share/artica-postfix/exec.pdns.php --mysql >/dev/null 2>&1 &"); } if ($PowerDNSMySQLType == 2) { if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} MySQL {$PowerDNSMySQLRemoteServer}@{$PowerDNSMySQLRemoteAdmin}\n"; } $G[] = "gmysql-host={$PowerDNSMySQLRemoteServer}"; $G[] = "gmysql-port={$PowerDNSMySQLRemotePort}"; $G[] = "gmysql-user={$PowerDNSMySQLRemoteAdmin}"; if ($PowerDNSMySQLRemotePassw != null) { $G[] = "gmysql-password={$PowerDNSMySQLRemotePassw}"; } $G[] = "gmysql-dbname=powerdns"; } if ($PowerDNSMySQLType == 3) { $mysql_server = $q->mysql_server; if ($mysql_server == 'localhost' or $mysql_server == "127.0.0.1") { $mysql_server = "127.0.0.1"; } $mysql_port = $q->mysql_port; if ($PowerUseGreenSQL == 1) { shell_exec("{$php5} /usr/share/artica-postfix/exec.greensql.php --sets"); $GreenPort = @file_get_contents("/etc/artica-postfix/settings/Mysql/GreenPort"); if (!is_numeric($GreenPort)) { $GreenPort = 3305; } $mysql_port = $GreenPort; } if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} MySQL {$mysql_server}:{$mysql_port}@{$database_admin}\n"; } $G[] = "gmysql-host={$mysql_server}"; $G[] = "gmysql-port={$mysql_port}"; $G[] = "gmysql-user={$database_admin}"; if ($database_password != null) { $G[] = "gmysql-password={$database_password}"; } $G[] = "gmysql-dbname=powerdns"; } $f[] = @implode("\n", $G); if ($PowerDNSDNSSEC == 1) { $f[] = "gmysql-dnssec"; } if ($PowerDNSDisableLDAP == 0) { $ldap = new clladp(); $f[] = "ldap-host={$ldap->ldap_host}:{$ldap->ldap_port}"; $f[] = "ldap-basedn=ou=dns,{$ldap->suffix}"; $f[] = "ldap-binddn=cn={$ldap->ldap_admin},{$ldap->suffix}"; $f[] = "ldap-secret={$ldap->ldap_password}"; $f[] = "ldap-method=simple"; } @mkdir("/etc/powerdns/pdns.d", 0755, true); if (is_file("/etc/pdns/pdns.conf")) { @file_put_contents("/etc/pdns/pdns.conf", @implode("\n", $f)); } @file_put_contents("/etc/powerdns/pdns.conf", @implode("\n", $f)); if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} pdns.conf done...\n"; } $f[] = array(); if ($PowerDNSDisableLDAP == 0) { $f[] = "ldap-host={$ldap->ldap_host}:{$ldap->ldap_port}"; $f[] = "ldap-basedn=ou=dns,{$ldap->suffix}"; $f[] = "ldap-binddn=cn={$ldap->ldap_admin},{$ldap->suffix}"; $f[] = "ldap-secret={$ldap->ldap_password}"; $f[] = "ldap-method=simple"; } $f[] = "recursor={$recursor}"; $f[] = @implode("\n", $G); @file_put_contents("/etc/powerdns/pdns.d/pdns.local", @implode("\n", $f)); if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} pdns.local done...\n"; } $f = array(); $CDIR = $cdirlist; if (count($RecursoripAllowFrom) > 0) { while (list($field, $value) = each($RecursoripAllowFrom)) { $CDIR[] = $value; } } while (list($field, $value) = each($CDIR)) { $AA[$value] = $value; } while (list($field, $value) = each($AA)) { $ALLOW[] = $field; } if (is_file('/etc/powerdns/forward-zones-file')) { $f[] = "forward-zones-file=/etc/powerdns/forward-zones-file"; } if (is_file('/etc/powerdns/forward-zones-recurse')) { $f[] = "forward-zones-recurse=" . trim(@file_get_contents('/etc/powerdns/forward-zones-recurse')); } $f[] = "local-address=127.0.0.1"; $f[] = "quiet=no"; $f[] = "config-dir=/etc/powerdns/"; $f[] = "daemon=yes"; $f[] = "local-port=1553"; $f[] = "log-common-errors=yes"; $f[] = "allow-from=" . @implode(",", $ALLOW); $f[] = "socket-dir=/var/run/pdns"; //$f[]="query-local-address6="; @file_put_contents("/etc/powerdns/recursor.conf", @implode("\n", $f)); if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} recursor.conf done...\n"; } if ($PowerDNSDNSSEC == 1) { shell_exec("{$php5} /usr/share/artica-postfix/exec.pdns.php --dnsseck"); } }
function save_routage() { $relayPort = $_GET["port"]; $relayIP = $_GET["remote"]; $domain_name = trim($_GET["domain"]); $ou = $_GET["ou"]; $tpl = new templates(); $ldap = new clladp(); if ($relayIP == "127.0.0.1") { echo $tpl->javascript_parse_text("{NO_RELAY_TO_THIS_SERVER_EXPLAIN}"); return; } $tc = new networking(); $IPSAR = $tc->ALL_IPS_GET_ARRAY(); if (!preg_match("#[0-9]\\.[0-9]+\\.[0-9]+\\.[0-9]+#", $relayIP)) { $ip = gethostbyname($relayIP); while (list($ip1, $ip2) = each($IPSAR)) { if ($relayIP == $ip1) { echo $tpl->javascript_parse_text("{NO_RELAY_TO_THIS_SERVER_EXPLAIN}"); return; } } } else { while (list($ip1, $ip2) = each($IPSAR)) { if ($relayIP == $ip1) { echo $tpl->javascript_parse_text("{NO_RELAY_TO_THIS_SERVER_EXPLAIN}"); return; } } } if (!$ldap->EditRelayDomain($ou, $domain_name, $relayIP, $relayPort)) { return; } $sock = new sockets(); $sock->getFrameWork("cmd.php?postfix-transport-maps=yes"); }
function popup_networks_masks() { include_once dirname(__FILE__) . "/ressources/class.tcpip.inc"; include_once dirname(__FILE__) . "/ressources/class.system.network.inc"; $net = new networking(); $class_ip = new IP(); $array = $net->ALL_IPS_GET_ARRAY(); while (list($index, $line) = each($array)) { $ip = $index; if (preg_match('#(.+?)\\.([0-9]+)$#', $ip, $re)) { $ip_start = $re[1] . ".0"; $ip_end = $re[1] . ".255"; $cdir = $class_ip->ip2cidr($ip_start, $ip_end); if (preg_match("#(.+)\\/([0-9]+)#", $cdir, $ri)) { $ipv4 = new ipv4($ri[1], $ri[2]); $netmask = $ipv4->netmask(); $hosts = $class_ip->HostsNumber($index, $netmask); $html = $html . "\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:16px;font-weight:bold'>{$ip_start}</td>\n\t\t\t\t\t<td style='font-size:16px;font-weight:bold'>{$netmask}</td>\n\t\t\t\t\t<td style='font-size:16px;font-weight:bold'>{$hosts}</td>\n\t\t\t\t\t\n\t\t\t\t</tr>"; } } } $html = "<H1>{newtork_help_me}</H1>\n\t<p class=caption>{you_should_use_one_of_these_network}</p>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<th>{from_ip_address}</th>\n\t\t<th>{netmask}</th>\n\t\t<th>{hosts_number}</th>\n\t</tr>\n\t{$html}\n\t</table>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function new_port() { $t = $_GET["t"]; include_once dirname(__FILE__) . "/ressources/class.system.network.inc"; $page = CurrentPageName(); $tpl = new templates(); $boot = new boostrap_form(); $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $ipz["0.0.0.0"] = "{all}"; while (list($ip, $line) = each($ips)) { $ipz[$ip] = $ip; } $boot->set_field("portname", "{rulename}", "MyNew port", array("ENCODE" => true)); $boot->set_field("aclport", "{listen_port}", "9090"); $boot->set_list("interface", "{listen_address}", $ipz, "0.0.0.0"); $boot->set_button("{add}"); $boot->set_hidden("bubble-add", "yes"); $boot->set_formtitle("{new_port}"); $boot->set_CallBack("LoadAjax('center-{$t}','{$page}?tabs=yes&t={$t}');"); $form = $boot->Compile(); echo $tpl->_ENGINE_parse_body($form); }
function listen_address_list(){ $sshd=new openssh(); $page=CurrentPageName(); $tcp=new networking(); $arrayip=$tcp->ALL_IPS_GET_ARRAY(); $arrayip["0.0.0.0"]="{all}"; unset($arrayip[null]); unset($arrayip["127.0.0.1"]); $field=Field_array_Hash($arrayip,"ListenAddressSSHDADD","0.0.0.0",null,null,0,"font-size:13px;padding:3px"); $html=" <center> <table class='tableView' style='width:250px'> <tr> <td>$field</td> <td style='font-size:13px;' width=1%>:</td> <td style='font-size:13px;'>".Field_text("ListenAddressSSHDPort",22,"font-size:13px;padding:3px;width:40px")."</td> <td width=1%>". button("{add}","AddSSHDNet()")."</td> </tr> </table> <table class='tableView' style='width:240px'> <thead class='thead'> <tr> <th> </th> <th colspan=2>{listen_ip}</th> </tr> </thead>"; if(is_array($sshd->ListenAddress)){ while (list ($num, $line) = each ($sshd->ListenAddress)){ if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";} $html=$html." <tr class=$classtr> <td width=1%><img src='img/fw_bold.gif'></td> <td><strong style='font-size:13px'>$line</strong></td> <td width=1%>". imgtootltip("ed_delete.gif","{delete}","ListenAddressSSHDDelete($num)")."</td> </tr> "; }} $html=$html."</table></center> <script> var x_AddSSHDNet= function (obj) { var tempvalue=obj.responseText; if(tempvalue.length>0){alert(tempvalue)}; RefreshListenAddress(); } function AddSSHDNet(){ var XHR = new XHRConnection(); XHR.appendData('ListenAddressSSHDADD',document.getElementById('ListenAddressSSHDADD').value); XHR.appendData('ListenAddressSSHDPort',document.getElementById('ListenAddressSSHDPort').value); document.getElementById('sshd_nets').innerHTML='<center><img src=img/wait_verybig.gif></center>'; XHR.sendAndLoad('$page', 'GET',x_AddSSHDNet); } function ListenAddressSSHDDelete(INDEX){ var XHR = new XHRConnection(); XHR.appendData('ListenAddressSSHDDelete',INDEX); document.getElementById('sshd_nets').innerHTML='<center><img src=img/wait_verybig.gif></center>'; XHR.sendAndLoad('$page', 'GET',x_AddSSHDNet); } </script> "; $tpl=new templates(); echo $tpl->_ENGINE_parse_body($html); }
function item_popup() { $button = "{add}"; $page = CurrentPageName(); $q = new mysql(); $t = time(); $zmd5 = $_GET["zmd5"]; $hostname = $_GET["hostname"]; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM sender_dependent_relay_host WHERE zmd5='{$zmd5}'", "artica_backup")); if ($zmd5 != null) { $button = "{save}"; } if (intval($ligne["relay_port"]) == 0) { $ligne["relay_port"] = 25; } $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $ips[null] = "{default}"; $nets = Field_array_Hash($ips, "smtp_bind_address-{$t}", $ligne["smtp_bind_address"], "style:font-size:22px;padding:3px"); $html = "\n<div style='width:98%' class=form>\n<table style='width:100%'>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{rule_enabled}</td>\n\t\t<td>" . Field_checkbox_design('enabled', 1, $ligne["enabled"]) . "</td>\n\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{order}:</strong></td>\n\t\t\t<td style='font-size:22px'>" . Field_text("zOrder-{$t}", $ligne["zOrders"], "font-size:22px;width:93px") . "</td>\n\t\t</tr>\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:22px'>{domain}:</strong></td>\n\t\t<td style='font-size:22px'>" . Field_text("domain-{$t}", $ligne["domain"], "font-size:22px;width:400px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{direct_mode}</td>\n\t\t<td>" . Field_checkbox_design('directmode', 1, $ligne["directmode"], "DirectMode{$t}()") . "</td>\n\t\t\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:22px'>{relay_address}:</strong></td>\n\t\t<td style='font-size:22px'>" . Field_text("relay_address-{$t}", $ligne["relay"], "font-size:22px;width:300px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:22px'>{listen_port}:</strong></td>\n\t\t<td style='font-size:22px'>" . Field_text("relay_port-{$t}", $ligne["relay_port"], "font-size:22px;width:90px") . "</td>\n\t</tr>\n\t\t\t\t\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{MX_lookups}</td>\n\t\t<td>" . Field_checkbox_design('MX_lookups', 1, $ligne["lookups"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{override_transport}</td>\n\t\t<td>" . Field_checkbox_design("override_transport-{$t}", 1, $ligne["override_transport"], "DirectMode2{$t}()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{override_relay}</td>\n\t\t<td>" . Field_checkbox_design("override_relay-{$t}", 1, $ligne["override_relay"]) . "</td>\n\t</tr>\n\t\t\t\t\n\t\t\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{smtp_bind_address}</td>\n\t\t<td style='font-size:22px'>{$nets}</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{smtp_helo_name}</td>\n\t\t<td style='font-size:22px'>" . Field_text("smtp_helo_name-{$t}", $ligne["smtp_helo_name"], "font-size:22px;width:300px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:22px' class=legend>{syslog_name}</td>\n\t\t<td style='font-size:22px'>" . Field_text("syslog_name-{$t}", $ligne["syslog_name"], "font-size:22px;width:300px") . "</td>\n\t</tr>\t\n\t\n\t\t\t\t\n\t\t\t\n\t<tr>\n\t\t<td align='right' colspan=2>" . button($button, "PostfixAddNewSenderTable{$t}()", 30) . "</td>\n\t</tr>\n</table>\n</div>\n<div class=text-info style='font-size:14px'>{sender_dependent_relayhost_maps_text}</div>\n<script>\nvar X_PostfixAddNewSenderTable{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tvar zmd5='{$zmd5}';\n\tif (results.length>0){alert(results);return;}\n\tif(zmd5.length==0){YahooWin4Hide();}\n\t\$('#SENDER_DEPENDENT_RELAY_HOST').flexReload();\n}\nfunction PostfixAddNewSenderTable{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('zmd5','{$zmd5}');\n\tXHR.appendData('hostname','{$hostname}');\n\tXHR.appendData('domain',document.getElementById('domain-{$t}').value);\n\tXHR.appendData('relay_address',document.getElementById('relay_address-{$t}').value);\n\tXHR.appendData('relay_port',document.getElementById('relay_port-{$t}').value);\n\tXHR.appendData('smtp_bind_address',document.getElementById('smtp_bind_address-{$t}').value);\n\tXHR.appendData('smtp_helo_name',document.getElementById('smtp_helo_name-{$t}').value);\n\tXHR.appendData('syslog_name',document.getElementById('syslog_name-{$t}').value);\n\tXHR.appendData('zOrder',document.getElementById('zOrder-{$t}').value);\n\t\n\t\n\t\n\tif(document.getElementById('override_transport-{$t}').checked){\n\t\tXHR.appendData('override_transport',1);\n\t}else{\n\t\tXHR.appendData('override_transport',0);\n\t}\n\n\tif(document.getElementById('override_relay-{$t}').checked){\n\t\tXHR.appendData('override_relay',1);\n\t}else{\n\t\tXHR.appendData('override_relay',0);\n\t}\t\t\n\t\n\tif(document.getElementById('MX_lookups').checked){\n\t\tXHR.appendData('MX_lookups',1);\n\t}else{\n\t\tXHR.appendData('MX_lookups',0);\n\t}\n\t\n\tif(document.getElementById('enabled').checked){\n\t\tXHR.appendData('enabled',1);\n\t}else{\n\t\tXHR.appendData('enabled',0);\n\t}\t\n\tif(document.getElementById('directmode').checked){\n\t\tXHR.appendData('directmode',1);\n\t}else{\n\t\tXHR.appendData('directmode',0);\n\t}\t\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',X_PostfixAddNewSenderTable{$t});\n}\n\nfunction DirectMode{$t}(){\n\tif(document.getElementById('directmode').checked){\n\t\tdocument.getElementById('relay_address-{$t}').disabled=true;\n\t\tdocument.getElementById('relay_port-{$t}').disabled=true;\n\t}else{\n\t\tdocument.getElementById('relay_address-{$t}').disabled=false;\n\t\tdocument.getElementById('relay_port-{$t}').disabled=false;\n\t}\n}\n\nfunction DirectMode2{$t}(){\n\tdocument.getElementById('smtp_bind_address-{$t}').disabled=true;\n\tdocument.getElementById('smtp_helo_name-{$t}').disabled=true;\n\tdocument.getElementById('syslog_name-{$t}').disabled=true;\n\n\n\tif(document.getElementById('override_transport-{$t}').checked){\n\t\tdocument.getElementById('smtp_bind_address-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_helo_name-{$t}').disabled=false;\n\t\tdocument.getElementById('syslog_name-{$t}').disabled=false;\n\t}\n}\n\n\n\nDirectMode{$t}();DirectMode2{$t}();\n</script>\n"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function index(){ $page=CurrentPageName(); $tpl=new templates(); $sock=new sockets(); $EnableFreeWeb=$sock->GET_INFO("EnableFreeWeb"); $FreeWebListen=$sock->GET_INFO("FreeWebListen"); $FreeWebListenPort=$sock->GET_INFO("FreeWebListenPort"); $FreeWebListenSSLPort=$sock->GET_INFO("FreeWebListenSSLPort"); $FreeWebListen=$sock->GET_INFO("FreeWebListen"); $FreeWebLeftMenu=$sock->GET_INFO("FreeWebLeftMenu"); if($FreeWebListen==null){$FreeWebListen="*";} if($EnableFreeWeb==null){$EnableFreeWeb=0;} if($FreeWebListenPort==null){$FreeWebListenPort=80;} if($FreeWebListenSSLPort==null){$FreeWebListenSSLPort=443;} if($FreeWebLeftMenu==null){$FreeWebLeftMenu=1;} $tcp=new networking(); $ips=$tcp->ALL_IPS_GET_ARRAY(); $ips["*"]="{all}"; $p=Paragraphe_switch_img("{enable_freeweb}","{enable_freeweb_text}","EnableFreeWeb",$EnableFreeWeb,null,400); $html=" <table style='width:100%'> <tr> <td valign='top'> <center><img src='img/free-web-128.png'></center> <hr> <div id='apache-src-status'></div> </td> <td valign='top'>$p <table style='width:100%;margin:5px;padding:5px;border:1px solid #CCCCCC'> <td class=legend>{add_to_left_menu}:</td> <td>". Field_checkbox("FreeWebLeftMenu",1,$FreeWebLeftMenu,"FreeWebLeftMenuCheck()")."</td> </tr> <tr> <td class=legend>{listen_ip}:</td> <td>". Field_array_Hash($ips,"FreeWebListen",$FreeWebListen,"style:font-size:13px;padding:3px")."</td> </tr> <tr> <td class=legend>{listen_port}:</td> <td>". Field_text("FreeWebListenPort",$FreeWebListenPort,"font-size:13px;padding:3px;width:60px")."</td> </tr> <tr> <td class=legend>{listen_port} SSL:</td> <td>". Field_text("FreeWebListenSSLPort",$FreeWebListenSSLPort,"font-size:13px;padding:3px;width:60px")."</td> </tr> </table> <hr> <div style='width:100%;text-align:right'>". button("{apply}","EnableFreeWebSave()")."</div> </td> </tr> </table> <script> function statusRefresh(){ LoadAjax('apache-src-status','$page?apache-src-status=yes'); } var x_EnableFreeWebSave=function (obj) { var results=obj.responseText; RefreshTab('main_config_freeweb'); } function EnableFreeWebSave(){ var XHR = new XHRConnection(); XHR.appendData('EnableFreeWeb',document.getElementById('EnableFreeWeb').value); XHR.appendData('FreeWebListen',document.getElementById('FreeWebListen').value); XHR.appendData('FreeWebListenPort',document.getElementById('FreeWebListenPort').value); XHR.appendData('FreeWebListenSSLPort',document.getElementById('FreeWebListenSSLPort').value); document.getElementById('img_EnableFreeWeb').src='img/wait_verybig.gif'; XHR.sendAndLoad('$page', 'GET',x_EnableFreeWebSave); } var x_FreeWebLeftMenuCheck=function (obj) { var results=obj.responseText; if(results.length>0){alert(results);} CacheOff(); } function FreeWebLeftMenuCheck(){ var XHR = new XHRConnection(); if(document.getElementById('FreeWebLeftMenu').checked){ XHR.appendData('FreeWebLeftMenu',1); }else{ XHR.appendData('FreeWebLeftMenu',1); } XHR.sendAndLoad('$page', 'GET',x_FreeWebLeftMenuCheck); } statusRefresh(); </script>"; echo $tpl->_ENGINE_parse_body($html); }
function BindInterfaceForm($noecho=0){ $page=CurrentPageName(); $ip=new networking(1); $array_IP=$ip->ALL_IPS_GET_ARRAY(); $array_IP["all"]="{all}"; $array_IP[null]="{select}"; $fieldIP=Field_array_Hash($array_IP,"inet_interface_select",null,null,null,0,"padding:3px;font-size:13px"); $BindInterfaceTable=BindInterfaceTable(); $html="<div id='BindInterfaceForm'> <table style='width:90%' align='center'> <tr> <td align='right' valign='top' nowrap class=legend>{give the new interface} :</strong></td> <td align='left'>" . Field_text('inet_interface_add',null,'width:80%;padding:3px;font-size:13px',null,null,'{inet_interfaces_text}') ."</td> </tr> <tr> <td align='right' valign='top' nowrap class=legend>{or} {select_ip_address} :</strong></td> <td align='left'>$fieldIP</td> </tr> <tr><td colspan=2 align='right'> <hr>". button("{add}","PostfixAddInterface()")." </td> </table> </div> <div id='interface_table' style='padding:10px'>$BindInterfaceTable</div> <script> var x_ReloadInterface= function (obj) { RefreshTab('main_config_postfix_net'); } function PostfixAddInterface(){ var ip_selected=document.getElementById('inet_interface_select').value; var inet_interface_add=document.getElementById('inet_interface_add').value; if (inet_interface_add.length==0){ if(ip_selected.length>0){ inet_interface_add=ip_selected; } } document.getElementById('inet_interface_add').value=''; document.getElementById('inet_interface_select').value=''; var XHR = new XHRConnection(); document.getElementById('BindInterfaceForm').innerHTML=\"<center style='width:100%'><img src='img/wait_verybig.gif'></center>\"; XHR.appendData('inet_interface_add',inet_interface_add); XHR.sendAndLoad('$page', 'GET',x_ReloadInterface); } function ReloadInterfaceTable(){ LoadAjax('BindInterfaceForm','postfix.network.php?section=BindInterfaceForm'); } function PostfixDeleteInterface(num){ var XHR = new XHRConnection(); XHR.appendData('PostfixDeleteInterface',num); document.getElementById('BindInterfaceForm').innerHTML=\"<center style='width:100%'><img src='img/wait_verybig.gif'></center>\"; XHR.sendAndLoad('$page', 'GET',x_ReloadInterface); } </script> "; $tpl=new templates(); if($noecho==1){return $tpl->_ENGINE_parse_body($html);} echo $tpl->_ENGINE_parse_body($html); }
function BindInterfaceForm_old($noecho = 0) { $page = CurrentPageName(); $ip = new networking(1); $array_IP = $ip->ALL_IPS_GET_ARRAY(); $array_IP["all"] = "{all}"; $array_IP[null] = "{select}"; $fieldIP = Field_array_Hash($array_IP, "inet_interface_select", null, null, null, 0, "padding:3px;font-size:14px"); $BindInterfaceTable = BindInterfaceTable(); $sock = new sockets(); $PostfixBindInterfacePort = $sock->GET_INFO("PostfixBindInterfacePort"); if (!is_numeric($PostfixBindInterfacePort)) { $PostfixBindInterfacePort = 25; } $html = "\n\t<div id='interface_table' style='padding:10px'>{$BindInterfaceTable}</div>\n\t<script>\n\t\t\n\t\n\t</script>\n\t"; $tpl = new templates(); if ($noecho == 1) { return $tpl->_ENGINE_parse_body($html); } echo $tpl->_ENGINE_parse_body($html); }
function main_parameters() { $tpl = new templates(); $page = CurrentPageName(); $servername = $_GET["servername"]; $rv = new squid_reverse(); $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_www WHERE servername='{$servername}'")); $ip = new networking(); $ipsH = $ip->ALL_IPS_GET_ARRAY(); $ipsH[null] = "{all}"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = "<tr><td colspan=2 style='font-size:36px;margin-bottom:20px'>{main_parameters}</td></tr>"; $html[] = "<tr><td colspan=2>" . Paragraphe_switch_img("{enable_website}", "{nginx_enable_www_text}", "enabled-{$t}", $ligne["enabled"], null, 820) . "</td></tr>"; $html[] = "<tr><td colspan=2>" . Paragraphe_switch_img("{default_server}", "{NGINX_DEFAULT_SERVER}<br>{nginx_default_server_text}", "default_server-{$t}", $ligne["default_server"], null, 820) . "</td></tr>"; $html[] = Field_text_table("zOrder-{$t}", "{order}", $ligne["zOrder"], 26, null, 90); $html[] = Field_list_table("ipaddr-{$t}", "{listen_address}", $ligne["ipaddr"], 26, $ipsH); $html[] = Field_text_table("port-{$t}", "{inbound_port}", $ligne["port"], 26, null, 110); $html[] = Field_text_table("RedirectQueries-{$t}", "{RedirectQueries}", $ligne["RedirectQueries"], 26, "{RedirectQueries_explain}", 480); $html[] = Field_button_table_autonome("{apply}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#NGINX_MAIN_TABLE').flexReload();\n\t\t\n\t}\n\n\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('servername','{$servername}');\n\t\tXHR.appendData('main-parameters','yes');\n\t\tXHR.appendData('enabled',document.getElementById('enabled-{$t}').value);\n\t\tXHR.appendData('zOrder',document.getElementById('zOrder-{$t}').value);\n\t\tXHR.appendData('default_server',document.getElementById('default_server-{$t}').value);\n\t\tXHR.appendData('port',document.getElementById('port-{$t}').value);\n\t\tXHR.appendData('ipaddr',document.getElementById('ipaddr-{$t}').value);\n\t\tXHR.appendData('RedirectQueries',encodeURIComponent(document.getElementById('RedirectQueries-{$t}').value));\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\t\n\t}\n</script>\t\t\t\n\t\t\t\n"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function rdpp_download() { $ID = $_GET["rdp-download"]; $q = new mysql_squid_builder(); $sock = new sockets(); $RDPProxyListen = $sock->GET_INFO("RDPProxyListen"); if ($RDPProxyListen == "0.0.0.0") { $net = new networking(); $ips = $net->ALL_IPS_GET_ARRAY(); unset($ips["127.0.0.1"]); while (list($num, $ligne) = each($ips)) { $RDPProxyListen = $num; break; } } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM rdpproxy_items WHERE ID='{$ID}'")); $f[] = "screen mode id:i:1"; $f[] = "use multimon:i:1"; $f[] = "desktopwidth:i:1024"; $f[] = "desktopheight:i:768"; $f[] = "session bpp:i:32"; $f[] = "winposstr:s:0,1,325,121,1365,927"; $f[] = "compression:i:1"; $f[] = "keyboardhook:i:2"; $f[] = "audiocapturemode:i:0"; $f[] = "videoplaybackmode:i:1"; $f[] = "connection type:i:2"; $f[] = "displayconnectionbar:i:1"; $f[] = "disable wallpaper:i:1"; $f[] = "allow font smoothing:i:0"; $f[] = "allow desktop composition:i:0"; $f[] = "disable full window drag:i:1"; $f[] = "disable menu anims:i:1"; $f[] = "disable themes:i:0"; $f[] = "disable cursor setting:i:0"; $f[] = "bitmapcachepersistenable:i:1"; $f[] = "full address:s:{$RDPProxyListen}"; $f[] = "audiomode:i:1"; $f[] = "redirectprinters:i:1"; $f[] = "redirectcomports:i:0"; $f[] = "redirectsmartcards:i:1"; $f[] = "redirectclipboard:i:1"; $f[] = "redirectposdevices:i:0"; $f[] = "redirectdirectx:i:1"; $f[] = "autoreconnection enabled:i:1"; $f[] = "authentication level:i:2"; $f[] = "prompt for credentials:i:0"; $f[] = "negotiate security layer:i:1"; $f[] = "remoteapplicationmode:i:0"; $f[] = "alternate shell:s:"; $f[] = "shell working directory:s:"; $f[] = "gatewayhostname:s:"; $f[] = "gatewayusagemethod:i:4"; $f[] = "gatewaycredentialssource:i:4"; $f[] = "gatewayprofileusagemethod:i:0"; $f[] = "promptcredentialonce:i:0"; $f[] = "use redirection server name:i:0"; $f[] = "drivestoredirect:s:Data (Z:);"; $f[] = "networkautodetect:i:1"; $f[] = "bandwidthautodetect:i:1"; $f[] = "enableworkspacereconnect:i:0"; $f[] = "rdgiskdcproxy:i:0"; $f[] = "kdcproxyname:s:"; $f[] = "gatewaybrokeringtype:i:0"; $f[] = "username:s:{$ligne['username']}/{$ligne['service']}"; $data = @implode("\r\n", $f); header('Content-type: application/x-rdp'); header('Content-Transfer-Encoding: binary'); header("Content-Disposition: attachment; filename=\"rdpprody-{$ligne['username']}@{$ligne['service']}.rdp\""); header("Pragma: public"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date dans le passé $fsize = strlen($data); header("Content-Length: " . $fsize); ob_clean(); flush(); echo $data; }
function parameters(){ $tpl=new templates(); $page=CurrentPageName(); $t=time(); $sock=new sockets(); $StreamCacheCache=$sock->GET_INFO("StreamCacheCache"); if($StreamCacheCache==null){$StreamCacheCache="/home/squid/videocache";} $StreamCacheMainCache=$sock->GET_INFO("StreamCacheMainCache"); if($StreamCacheMainCache==null){$StreamCacheMainCache="/home/squid/streamcache";} $StreamCacheBindHTTP=$sock->GET_INFO("StreamCacheBindHTTP"); $StreamCacheBindProxy=$sock->GET_INFO("StreamCacheBindProxy"); $ip=new networking(); $ips=$ip->ALL_IPS_GET_ARRAY(); unset($ips["127.0.0.1"]); unset($ips["0.0.0.0"]); $ips2=$ip->ALL_IPS_GET_ARRAY(); unset($ips2["0.0.0.0"]); $ips3[null]="{none}"; $ips3=$ip->ALL_IPS_GET_ARRAY(); unset($ips3["0.0.0.0"]); unset($ips3["127.0.0.1"]); $html="<div style=width:98% class=form> <table style='width:100%'> <tr> <td colspan=3 style='font-size:32px'>{APP_VIDEOCACHE}<hr></td> </tr> <tr> <td class=legend style='font-size:22px'>{webserver} ({listen_address}):</td> <td style='font-size:18px'>". Field_array_Hash($ips,"StreamCacheBindHTTP",$StreamCacheBindHTTP,"style:font-size:22px")."<td> <td style='font-size:18px' width=1%><td> </tr> <tr> <td colspan=3 style='font-size:22px'>{caches}<hr></td> </tr> <tr> <td class=legend style='font-size:22px'>{videos_storage}:</td> <td style='font-size:22px'>". Field_text("StreamCacheCache",$StreamCacheCache,"font-size:18px;width:350px")."</td> <td>". button_browse("StreamCacheCache")."</td> </tr> <tr> <td colspan=3 align='right' style='padding-top:20px'><hr>". button("{apply}", "Save$t()",32)."</td> </tr> </table> <script> var xSave$t= function (obj) { var results=obj.responseText; if(results.length>3){alert(results);return;} Loadjs('squid.reconfigure.php?ask=yes'); } function Save$t(){ var XHR = new XHRConnection(); XHR.appendData('StreamCacheCache', document.getElementById('StreamCacheCache').value); XHR.appendData('StreamCacheBindHTTP', document.getElementById('StreamCacheBindHTTP').value); XHR.sendAndLoad('$page', 'POST',xSave$t); } </script>"; echo $tpl->_ENGINE_parse_body($html); }