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() { $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() { $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_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() { $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 interface_popup() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_shorewall(); $bt_title = "{add}"; $ID = $_GET["ID"]; if ($ID == null) { $title = $tpl->javascript_parse_text("{link_interface}"); } if ($ID != null) { $bt_title = "{apply}"; $q = new mysql_shorewall(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT eth FROM fw_interfaces WHERE eth='{$ID}'")); $ip = new system_nic($ID); $title = $tpl->javascript_parse_text("{interface}: {$ip->NICNAME} - " . $ligne["eth"]); } $net = new networking(); $ethz = $net->Local_interfaces(); while (list($num, $ligne) = each($ethz)) { $ip = new system_nic($num); $ethz[$num] = "{$ip->NICNAME} ({$num})"; } $t = time(); $html = "\n\t<div style='font-size:20px'>{$title}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{interface}:</td>\n\t\t<td>" . Field_array_Hash($ethz, "interface-{$t}", $ligne["type"], null, null, 0, "font-size:16px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button($bt_title, "Save{$t}()", 18) . "</td>\n\t</tr>\t\t\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\tvar ID='{$ID}';\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\t\$('#flexRT{$_GET["tt"]}').flexReload();\n\tExecuteByClassName('SearchFunction');\n\tif(ID.length==0){YahooWinHide();}\n}\n\nfunction SaveCHK{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\t\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('interface-save', encodeURIComponent(document.getElementById('interface-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $t = time(); $sock = new sockets(); $squid = new squidbee(); $EnableSS5 = intval($sock->GET_INFO("EnableSS5")); $EnableSS5P = Paragraphe_switch_img("{EnableSS5}", "{APP_SS5_ABOUT}", "EnableSS5", $EnableSS5, null, 900); $SS5_SOCKS_PORT = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/SS5_SOCKS_PORT")); $SS5_SOCKS_INTERFACE = @file_get_contents("/etc/artica-postfix/settings/Daemons/SS5_SOCKS_INTERFACE"); $ip = new networking(); $interfaces = $ip->Local_interfaces(); unset($interfaces["lo"]); $array[null] = "{all}"; if ($SS5_SOCKS_PORT == 0) { $SS5_SOCKS_PORT = rand(1024, 63000); } while (list($eth, $none) = each($interfaces)) { if (preg_match("#^gre#", $eth)) { continue; } $nic = new system_nic($eth); $array[$eth] = "{$eth} {$nic->IPADDR} - {$nic->NICNAME}"; } $html = "\n\t<div style='font-size:32px;margin-bottom:30px'>{APP_SS5}</div>\n\t<div style=width:98% class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t<td style='vertical-align:top;width:285px'><div id='services-ss5-status'></div></td>\n\t<td style='vertical-align:top;width:915px'>\n\t<div style='width:98%' class=form>\n\t{$EnableSS5P}\n\t<hr>\n\t\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:24px;font-wieght:bold'>{listen_interface}:</td>\n\t\t<td style='font-size:20px'>" . Field_array_Hash($array, "SS5_SOCKS_INTERFACE", $SS5_SOCKS_INTERFACE, "style:font-size:24px;font-wieght:bold") . "</td>\n\t\t\n\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:24px;font-wieght:bold'>{listen_port}:</td>\n\t\t<td style='font-size:20px'>" . field_text("SS5_SOCKS_PORT", $SS5_SOCKS_PORT, "font-size:24px;width:90px;font-wieght:bold") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<div style='text-align:right;margin-top:50px'>" . button("{apply}", "Save{$t}()", 40) . "</div>\n\t</div>\n\t</td>\n\t</tr>\n\t</table>\n\t<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\tLoadjs('ss5.progress.php');\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('EnableSS5', document.getElementById('EnableSS5').value);\n\tXHR.appendData('SS5_SOCKS_INTERFACE', document.getElementById('SS5_SOCKS_INTERFACE').value);\n\tXHR.appendData('SS5_SOCKS_PORT', document.getElementById('SS5_SOCKS_PORT').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\tLoadAjax('services-ss5-status','{$page}?services-ss5-status=yes',false);\n</script>"; 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 add_interface_popup() { $page = CurrentPageName(); $tpl = new templates(); $t = time(); $nic = new networking(); $nicZ = $nic->Local_interfaces(); $NICS[null] = "{select}"; while (list($yinter, $line) = each($nicZ)) { $znic = new system_nic($yinter); if ($znic->Bridged == 1) { continue; } $NICS[$yinter] = "[{$yinter}] - {$znic->NICNAME}"; } $interface_field = "\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{interface}:</td>\n\t\t<td>" . Field_array_Hash($NICS, "eth-{$t}", $_GET["eth"], "style:font-size:22px") . "</td>\n\t</tr>"; if ($_GET["eth"] != null) { $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM suricata_interfaces WHERE interface='{$_GET["eth"]}'", "artica_backup")); $title = "{$_GET["eth"]}::" . $tpl->javascript_parse_text($ligne["rulename"]); $interface_field = "\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>{interface}:</td>\n\t\t\t<td style='font-size:22px;font-weight:bold'>{$NICS[$_GET["eth"]]}\n\t\t\t\t<input type='hidden' id='eth-{$t}' value='{$_GET["eth"]}'>\n\t\t\t</td>\n\t\t</tr>"; } else { $ligne["threads"] = 2; $ligne["enable"] = 1; } $html = "\n<center id='id-{$t}' style='width:98%' class=form>\n\t<table style=width:100%'>\n\t<tbody>\n\t{$interface_field}\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{enabled}:</td>\n\t\t<td>" . Field_checkbox_design("enabled-{$t}", 1, $ligne["enable"]) . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{threads}</td>\n\t\t<td>" . Field_text("threads-{$t}", null, "font-size:22px;padding:3px;width:150px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{add}", "Save{$t}()", 30) . "</td>\n\t</tr>\n\t</tbody>\n</table>\n</center>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\t\$('#TABLE_SURICATA_INTERFACE').flexReload();\n\tYahooWin4Hide();\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('eth',document.getElementById('eth-{$t}').value);\n\tXHR.appendData('threads',document.getElementById('threads-{$t}').value);\n\tif(document.getElementById('enabled-{$t}').checked){\n\t\tXHR.appendData('enabled',1); }else{ XHR.appendData('enabled',0); \n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\n"; echo $tpl->_ENGINE_parse_body($html); }
function page() { $sock = new sockets(); $page = CurrentPageName(); $tpl = new templates(); $MikrotikTransparent = intval($sock->GET_INFO('MikrotikTransparent')); $MikrotikHTTPSquidPort = intval($sock->GET_INFO('MikrotikHTTPSquidPort')); $MikrotikVirtualIP = $sock->GET_INFO('MikrotikVirtualIP'); $MikrotikLocalInterface = $sock->GET_INFO('MikrotikLocalInterface'); $MikrotikNetMask = $sock->GET_INFO('MikrotikNetMask'); $MikrotikIPAddr = $sock->GET_INFO('MikrotikIPAddr'); $MikrotikLAN = $sock->GET_INFO('MikrotikLAN'); $MikrotikSSLTransparent = intval($sock->GET_INFO("MikrotikSSLTransparent")); $MikrotikHTTPSSquidPort = intval($sock->GET_INFO("MikrotikHTTPSSquidPort")); $ip = new networking(); $ipsH = $ip->Local_interfaces(); $t = time(); if ($MikrotikHTTPSquidPort == 0) { $MikrotikHTTPSquidPort = rand(9090, 63000); } if ($MikrotikHTTPSSquidPort == 0) { $MikrotikHTTPSSquidPort = rand(9190, 63000); } if ($MikrotikVirtualIP == null) { $MikrotikVirtualIP = "172.16.24.2"; } if ($MikrotikNetMask == null) { $MikrotikNetMask = "255.255.255.252"; } if ($MikrotikIPAddr == null) { $MikrotikIPAddr = "172.16.24.1"; } if ($MikrotikLAN == null) { $MikrotikLAN = "192.168.1.0/24"; } if ($MikrotikLocalInterface == null) { $MikrotikLocalInterface = "eth0"; } $ARRAYBT["{apply}"] = "Apply{$t}"; $ARRAYBT["{save}"] = "Save{$t}"; $p = Paragraphe_switch_img("{mikrotik_compliance}", "{mikrotik_compliance_explain}", "MikrotikTransparent", $MikrotikTransparent, null, 760); $p2 = Paragraphe_switch_img("{mikrotik_ssl_compliance}", "{mikrotik_ssl_compliance_explain}", "MikrotikSSLTransparent", $MikrotikSSLTransparent, null, 760); $html = "\n\t<div style='text-align:right'><img src='img/mikrotik-150.png'></div>\n\t<div style='width:95%;padding:30px' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td style='vertical-align:top;width:220px'><div id='mikrotik-ipface'></div></td>\n\t\t<td style='vertical-align:top;width:99%;padding-left:30px'>\n\t\n\t\t\t{$p}{$p2}\n\t\t</td>\n\t</table>\n\t<table style='width:100%'>\n\t" . Field_text_table("MikrotikHTTPSquidPort", "{proxy_listen_port}", $MikrotikHTTPSquidPort, 22, null) . Field_text_table("MikrotikHTTPSSquidPort", "{proxy_listen_port} (SSL)", $MikrotikHTTPSSquidPort, 22, null) . Field_list_table("MikrotikLocalInterface", "{local_interface}", $MikrotikLocalInterface, 22, $ipsH) . Field_ipv4_table("MikrotikVirtualIP", "{local_ip_address}", $MikrotikVirtualIP, 22, "{MikrotikVirtualIP}", null) . Field_text_table("MikrotikNetMask", "{netmask}", $MikrotikNetMask, 22) . Field_ipv4_table("MikrotikIPAddr", "{mikrotik_address}", $MikrotikIPAddr, 22, "{mikrotik_address_explain}") . Field_area_table("MikrotikLAN", "{your_network}", $MikrotikLAN, 22, null) . Field_buttons_table_autonome($ARRAYBT, 32) . "\n\t</table>\n\t<div id='mikrotik-config'></div>\n</div>\n\n\n<script>\n\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\t\n\t\tdocument.getElementById('mikrotik-config').innerHTML=res;\n\n\t}\t\n\t\n\t\n\t\n\t\n\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('MikrotikSSLTransparent',document.getElementById('MikrotikSSLTransparent').value);\n\t\tXHR.appendData('MikrotikLocalInterface',document.getElementById('MikrotikLocalInterface').value);\n\t\tXHR.appendData('MikrotikTransparent',document.getElementById('MikrotikTransparent').value);\n\t\tXHR.appendData('MikrotikHTTPSquidPort',document.getElementById('MikrotikHTTPSquidPort').value);\n\t\tXHR.appendData('MikrotikHTTPSSquidPort',document.getElementById('MikrotikHTTPSSquidPort').value);\n\t\tXHR.appendData('MikrotikVirtualIP',document.getElementById('MikrotikVirtualIP').value);\n\t\tXHR.appendData('MikrotikNetMask',document.getElementById('MikrotikNetMask').value);\n\t\tXHR.appendData('MikrotikIPAddr',document.getElementById('MikrotikIPAddr').value);\n\t\tXHR.appendData('MikrotikLAN',document.getElementById('MikrotikLAN').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\t\nfunction Apply{$t}(){\t\n\tSave{$t}();\n\tLoadjs('squid.compile.progress.php?restart=yes&ask=yes');\n}\n\t\nSave{$t}();\nLoadAjax('mikrotik-ipface','{$page}?mikrotik-ipface=yes');\n</script>\t\t\t\t\t\n\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function table() { $tpl = new templates(); $page = CurrentPageName(); $users = new usersMenus(); $sock = new sockets(); $net = new networking(); $interfaces = $net->Local_interfaces(); unset($interfaces["lo"]); if (!$users->CONNTRACK_INSTALLED) { echo FATAL_ERROR_SHOW_128("{conntrackd_not_installed}"); return; } $network_bridges = $tpl->_ENGINE_parse_body("{network_bridges}"); $from = $tpl->javascript_parse_text("{from}"); $to = $tpl->javascript_parse_text("{to}"); $status = $tpl->_ENGINE_parse_body("{status}"); $source_port = $tpl->javascript_parse_text("{source_port}"); $to = $tpl->_ENGINE_parse_body("{to}"); $t = $_GET["t"]; if (!is_numeric($t)) { $t = time(); } $tablesize = 868; $descriptionsize = 705; $bts = array(); $add = $tpl->_ENGINE_parse_body("{new_network_bridge}"); $delete = $tpl->javascript_parse_text("{delete}"); $destination_port = $tpl->javascript_parse_text("{destination_port}"); $connections_tracking = $tpl->javascript_parse_text("{connections_tracking}"); $bts[] = "{name: '{$add}', bclass: 'add', onpress :RuleAdd{$t}},"; $bts[] = "{name: '{$reconstruct}', bclass: 'apply', onpress : BuildVLANs{$t}},"; $ERROR_NO_PRIVS = $tpl->javascript_parse_text("{ERROR_NO_PRIVS}"); $DisableNetworksManagement = $sock->GET_INFO("DisableNetworksManagement"); if ($DisableNetworksManagement == null) { $DisableNetworksManagement = 0; } if (count($bts) > 0) { $buttons = "buttons : [" . @implode("\n", $bts) . " ],"; } $reboot_network_explain = $tpl->_ENGINE_parse_body("{bridges_iptables_explain}<p> </p>{reboot_network_explain}"); $buttons = null; $html = "\n\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\n\t<script>\n\tvar mm{$t}=0;\n\t\$(document).ready(function(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?list=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: 'PROTO', name : 'PROTO', width : 50, sortable : false, align: 'center'},\n\t{display: '{$from}', name : 'from', width : 169, sortable : false, align: 'left'},\n\t{display: ' ', name : 'fromZ', width : 160, sortable : false, align: 'left'},\n\t{display: ' ', name : 'fromT', width : 45, sortable : false, align: 'left'},\n\t{display: ' ', name : 'none1', width : 121, sortable : false, align: 'center'},\n\t{display: '{$to}', name : 'to', width : 169, sortable : false, align: 'left'},\n\t{display: ' ', name : 'ToZ', width : 160, sortable : false, align: 'left'},\n\t{display: ' ', name : 'ToT', width : 45, sortable : false, align: 'left'},\n\t{display: '{$status}', name : 'delete', width : 120, sortable : false, align: 'center'},\n\t],{$buttons}\n\tsearchitems : [\n\t{display: '{$from}', name : 'src'},\n\t{display: '{$source_port}', name : 'sport'},\n\t{display: '{$to}', name : 'dst'},\n\t{display: '{$destination_port}', name : 'dport'},\n\n\n\n\t],\n\tsortname: 'ID',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$connections_tracking}',\n\tuseRp: true,\n\trp: 25,\n\trpOptions: [25,50,100,200,500,1000],\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 400,\n\tsingleSelect: true\n\n});\n});\n\nfunction RuleAdd{$t}(){\nLoadjs('{$page}?network-bridge-js=yes&ID=0&t={$t}',true);\n}\n\nfunction BuildVLANs{$t}(){\nLoadjs('network.restart.php?t={$t}');\n\n}\n\n\n\nfunction EmptyTask{$t}(){\nif(confirm('{$empty}::{$_GET["taskid"]}')){\n\n}\n}\n\n\n</script>\n\n"; echo $tpl->_ENGINE_parse_body($html); }
function SaveAddress() { $ip = new networking(); $server = $_GET["address_server"]; if (trim($server) == null) { echo "Host cannot be null!\n"; return; } $adip = "{$_GET["addr_1"]}.{$_GET["addr_2"]}.{$_GET["addr_3"]}.{$_GET["addr_4"]}"; if (!$ip->checkIP($adip)) { echo "IP {$adip}\nFailed"; return; } $conf = new dnsmasq(); $conf->array_address[$server] = $adip; writelogs("save {$server} {$adip}", __FUNCTION__, __FILE__); $conf->SaveConf(); }
function provider_popup() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_shorewall(); $bt_title = "{add}"; $ID = $_GET["ID"]; if ($ID == null) { $title = $tpl->javascript_parse_text("{new_provider}"); } $tables["main"] = "main"; $tables["local"] = "local"; $tables["default"] = "default"; $sql = "SELECT NAME FROM `fw_providers`"; $results = $q->QUERY_SQL($sql); while ($ligne = mysql_fetch_assoc($results)) { $tables[$ligne["NAME"]] = $ligne["NAME"]; } $net = new networking(); $ethz = $net->Local_interfaces(); while (list($num, $ligne) = each($ethz)) { $ip = new system_nic($num); $ethz[$num] = "{$ip->NICNAME} ({$num})"; } if ($ID > 0) { $bt_title = "{apply}"; $q = new mysql_shorewall(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM fw_providers WHERE ID='{$ID}'")); $ip = new system_nic($ligne["INTERFACE"]); $title = $tpl->javascript_parse_text("{interface}: {$ip->NICNAME} - " . $ligne["NAME"]); } for ($i = 1; $i < 16; $i++) { $table_number[$i] = $i; } if (!is_numeric($ligne["balance"])) { $ligne["balance"] = -1; } if (!is_numeric($ligne["fallback"])) { $ligne["fallback"] = -1; } $t = time(); $html = "\n\t<div style='font-size:20px;margin-bottom:20px'>{$title}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{name}:</td>\n\t\t<td>" . Field_text("NAME-{$t}", $ligne["NAME"], "font-size:18px;width:190px", null, null, null, false, "SaveCHK{$t}(event)") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{interface}:</td>\n\t\t<td>" . Field_array_Hash($ethz, "INTERFACE-{$t}", $ligne["INTERFACE"], null, null, 0, "font-size:16px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{gateway}:</td>\n\t\t<td>" . Field_text("GATEWAY-{$t}", $ligne["GATEWAY"], "font-size:18px;width:190px", null, null, null, false, "SaveCHK{$t}(event)") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{unique_number}:</td>\n\t\t<td>" . Field_array_Hash($table_number, "NUMBER-{$t}", $ligne["NUMBER"], null, null, 0, "font-size:16px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{balance}:</td>\n\t\t<td>" . Field_text("balance-{$t}", $ligne["balance"], "font-size:18px;width:40px", null, null, null, false, "SaveCHK{$t}(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{fallback}:</td>\n\t\t<td>" . Field_text("fallback-{$t}", $ligne["fallback"], "font-size:18px;width:40px", null, null, null, false, "SaveCHK{$t}(event)") . "</td>\n\t</tr>\t\t\t\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{routing_table}:</td>\n\t\t<td>" . Field_array_Hash($tables, "DUPLICATE-{$t}", $ligne["DUPLICATE"], null, null, 0, "font-size:16px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{routing_track}:</td>\n\t\t<td>" . Field_checkbox("track-{$t}", 1, $ligne["track"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{routing_tproxy}:</td>\n\t\t<td>" . Field_checkbox("tproxy-{$t}", 1, $ligne["tproxy"]) . "</td>\n\t</tr>\t\t\t\t\n\t\t\t\t\n\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button($bt_title, "Save{$t}()", 18) . "</td>\n\t</tr>\t\t\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\tvar ID='{$ID}';\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\t\$('#flexRT{$_GET["tt"]}').flexReload();\n\tExecuteByClassName('SearchFunction');\n\tif(ID.length==0){YahooWinHide();}\n}\n\nfunction SaveCHK{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\t\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('provider-save', '{$ID}');\n\tXHR.appendData('NAME', document.getElementById('NAME-{$t}').value);\n\tXHR.appendData('INTERFACE', document.getElementById('INTERFACE-{$t}').value);\n\tXHR.appendData('DUPLICATE', document.getElementById('DUPLICATE-{$t}').value);\n\tXHR.appendData('GATEWAY', document.getElementById('GATEWAY-{$t}').value);\n\tXHR.appendData('NUMBER', document.getElementById('NUMBER-{$t}').value);\n\t\n\tXHR.appendData('fallback', document.getElementById('fallback-{$t}').value);\n\tXHR.appendData('balance', document.getElementById('balance-{$t}').value);\n\t\n\tif(document.getElementById('track-{$t}').checked){ XHR.appendData('track', 1); }else{ XHR.appendData('track', 0); }\n\tif(document.getElementById('tproxy-{$t}').checked){ XHR.appendData('tproxy', 1); }else{ XHR.appendData('tproxy', 0); }\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\t"; echo $tpl->_ENGINE_parse_body($html); }
function parameters() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $t = time(); $ip = new networking(); $interfaces = $ip->Local_interfaces(); unset($interfaces["lo"]); $UnifiListenInterface = $sock->GET_INFO("UnifiListenInterface"); $UnifiHTTPPort = intval($sock->GET_INFO("UnifiHTTPPort")); $UnifiHTTPSPort = intval($sock->GET_INFO("UnifiHTTPSPort")); $UnifiPortalPort = intval($sock->GET_INFO("UnifiPortalPort")); $UnifiPortalSSLPort = intval($sock->GET_INFO("UnifiPortalSSLPort")); $UnifiUDPPort = intval($sock->GET_INFO("UnifiUDPPort")); $UnifiUUID = $sock->GET_INFO("UnifiUUID"); if ($UnifiUUID == null) { $UnifiUUID = $sock->getFrameWork("unifi.php?GetUUID=yes"); } if ($UnifiHTTPPort == 0) { $UnifiHTTPPort = 8088; } if ($UnifiHTTPSPort == 0) { $UnifiHTTPSPort = 8443; } if ($UnifiPortalPort == 0) { $UnifiPortalPort = 8880; } if ($UnifiPortalSSLPort == 0) { $UnifiPortalSSLPort = 8943; } if ($UnifiUDPPort == 0) { $UnifiUDPPort = 3478; } while (list($eth, $none) = each($interfaces)) { $nic = new system_nic($eth); $array[$eth] = "{$eth} {$nic->IPADDR} - {$nic->NICNAME}"; } $array[null] = "{all}"; $EnableUnifiController = intval($sock->GET_INFO("EnableUnifiController")); $p = Paragraphe_switch_img("{ENABLE_UNIFI_CONTROLLER}", "{UNIFI_CONTROLLER_EXPLAIN}", "EnableUnifiController", $EnableUnifiController, null, 890); $html = "<div style='font-size:30px;margin-bottom:20px'>{parameters}</div>\n\t<div style='width:98%' class=form>{$p}\n\t\n\t<div style='font-size:26px;margin-bottom:10px;text-align:right'><a href=\"https://{$_SERVER["SERVER_NAME"]}:{$UnifiHTTPSPort}\" style='text-decoration:underline' target=_new>{web_interface}</a></div>\n\t\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{listen_interface}:</td>\n\t\t<td style='font-size:20px'>" . Field_array_Hash($array, "UnifiListenInterface-{$t}", $UnifiListenInterface, "style:font-size:22px;font-weight:bold") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{UnifiHTTPPort}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiHTTPPort-{$t}", $UnifiHTTPPort, "font-size:22px;font-weight:bold;width:150px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{UnifiHTTPSPort}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiHTTPSPort-{$t}", $UnifiHTTPSPort, "font-size:22px;font-weight:bold;width:150px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{UnifiPortalPort}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiPortalPort-{$t}", $UnifiPortalPort, "font-size:22px;font-weight:bold;width:150px") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{UnifiPortalSSLPort}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiPortalSSLPort-{$t}", $UnifiPortalSSLPort, "font-size:22px;font-weight:bold;width:150px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{UnifiUDPPort}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiUDPPort-{$t}", $UnifiUDPPort, "font-size:22px;font-weight:bold;width:150px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{uuid}:</td>\n\t\t<td style='font-size:20px'>" . Field_text("UnifiUUID-{$t}", $UnifiUUID, "font-size:22px;font-weight:bold;width:560px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr style='height:70px'>\n\t\t\t\t<td style=';text-align:right' colspan=2>" . button("{apply}", "Save{$t}()", "32") . "</td>\n\t</tr>\t\n\t\n\t</table>\n<script>\n\tvar xSave{$t}=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif (tempvalue.length>3){alert(tempvalue);return;}\n\t\tRefreshTab('unifi_tabs');\n\t\tLoadjs('unifi.restart.progress.php');\n\t\t\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\tXHR.appendData('EnableUnifiController',document.getElementById('EnableUnifiController').value);\n\t\tXHR.appendData('UnifiListenInterface',document.getElementById('UnifiListenInterface-{$t}').value);\n\t\tXHR.appendData('UnifiHTTPPort',document.getElementById('UnifiHTTPPort-{$t}').value);\n\t\tXHR.appendData('UnifiHTTPSPort',encodeURIComponent(document.getElementById('UnifiHTTPSPort-{$t}').value));\n\t\tXHR.appendData('UnifiPortalPort',document.getElementById('UnifiPortalPort-{$t}').value);\n\t\tXHR.appendData('UnifiPortalSSLPort',document.getElementById('UnifiPortalSSLPort-{$t}').value);\n\t\tXHR.appendData('UnifiUDPPort',encodeURIComponent(document.getElementById('UnifiUDPPort-{$t}').value));\n\t\tXHR.appendData('UnifiUUID',encodeURIComponent(document.getElementById('UnifiUUID-{$t}').value));\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\n\t\nLoadAjaxRound('unifi-status','{$page}?status=yes');\t\n\t\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $users = new usersMenus(); $SquidNetworkSwitch = $sock->GET_INFO("SquidNetworkSwitch"); $net = new networking(); $interfaces = $net->Local_interfaces(); unset($interfaces["lo"]); $t = $_GET["t"]; $array[null] = "{default}"; while (list($eth, $none) = each($interfaces)) { $nic = new system_nic($eth); $array[$eth] = "{$eth} {$nic->IPADDR} - {$nic->NICNAME}"; } $html = "<div style='width:98%' class=form>\n\t\t<div style='font-size:22px;margin-bottom:20px' class=explain>\n\t\t{squid_network_switch_explain}\n\t\t</div>\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:26px' nowrap>{outgoing_interface}:</td>\n\t\t<td>" . Field_array_Hash($array, "SquidNetworkSwitch-{$t}", $SquidNetworkSwitch, "style:font-size:26px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right' style='padding-top:50px'><hr>" . button("{apply}", "Save{$t}();", "36") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadjs('squid.network.switch.progress.php');\n}\t\n\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('SquidNetworkSwitch', document.getElementById('SquidNetworkSwitch-{$t}').value);\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \t\t\t\n}\n</script>\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function step1() { $q = new mysql(); $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $net = new networking(); $interfaces = $net->Local_interfaces(); unset($interfaces["lo"]); $t = $_GET["t"]; while (list($eth, $none) = each($interfaces)) { $nic = new system_nic($eth); $array[$eth] = "{$eth} {$nic->IPADDR} - {$nic->NICNAME}"; $array2[$eth] = "{$eth} {$nic->IPADDR} - {$nic->NICNAME}"; } $FireHolConf = unserialize(base64_decode($sock->GET_INFO("FireHolConf"))); $html = "\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td colspan=2><div class=explain style='font-size:20px;margin-bottom:15px'>{select_wan_interface_explain}</div></td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px' nowrap>{interface} WAN:</td>\n\t\t\t<td>" . Field_array_Hash($array, "IF_WAN-{$t}", $FireHolConf["IF_WAN"], "style:font-size:28px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2><hr></td>\n\t\t</tr>\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2><div class=explain style='font-size:20px;margin-bottom:15px'>{select_lan_interface_explain}</div></td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px' nowrap>{interface} LAN:</td>\n\t\t\t<td>" . Field_array_Hash($array, "IF_LAN-{$t}", $FireHolConf["IF_LAN"], "style:font-size:28px") . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align=right style='text-align:right;padding-top:20px'><hr>" . button("{next}", "Save{$t}();", "32") . "</td>\n\t\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadAjax('{$t}','{$page}?stepfinal=yes&t={$t}');\n}\t\n\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('IF_WAN', document.getElementById('IF_WAN-{$t}').value);\n\tXHR.appendData('IF_LAN', document.getElementById('IF_LAN-{$t}').value);\t\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \t\t\t\n}\n</script>"; 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 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 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 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 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 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 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); }