function wizard_certificate_1() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $hostname = $sock->GET_INFO("myhostname"); $t = time(); $ENC[1024] = 1024; $ENC[2048] = 2048; $ENC[4096] = 4096; if ($hostname == null) { $hostname = $sock->getFrameWork("system.php?hostname-g=yes"); $sock->SET_INFO($hostname, "myhostname"); } $title = $tpl->_ENGINE_parse_body("{new_certificate}"); $html[] = "<div class=text-info style='font-size:18px'>{wizard_certificate_1}<br><i>{CSR_MULTIPLE_EXPLAIN}</i></div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("wizard-certificate-commonname", "{CommonName}", $hostname, 22, null, 400); $html[] = Field_list_table("wizard-certificate-levelenc", "{level_encryption}", 2048, 22, $ENC); $html[] = Field_password_table("wizard-certificate-password", "{password}", "secret", 22, null, 300); $html[] = Field_button_table_autonome("{add}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\tYahooWin6Hide();\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('wizard-certificate-commonname',encodeURIComponent(document.getElementById('wizard-certificate-commonname').value));\n\tXHR.appendData('wizard-certificate-levelenc',document.getElementById('wizard-certificate-levelenc').value);\n\tXHR.appendData('wizard-certificate-password',encodeURIComponent(document.getElementById('wizard-certificate-password').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function popup() { $page = CurrentPageName(); $sock = new sockets(); $users = new usersMenus(); $t = time(); $SquidGuardIPWeb = $sock->GET_INFO("SquidGuardIPWeb"); $fulluri = $sock->GET_INFO("SquidGuardIPWeb"); $SquidGuardServerName = $sock->GET_INFO("SquidGuardServerName"); if (preg_match("#\\/(.+?):([0-9]+)\\/#", $SquidGuardIPWeb, $re)) { $SquidGuardIPWeb = "{$re[1]}:{$re[2]}"; } if (preg_match("#(.+?):([0-9]+)#", $SquidGuardIPWeb, $re)) { $SquidGuardServerName = $re[1]; $SquidGuardApachePort = $re[2]; } if ($SquidGuardServerName == "/") { $SquidGuardServerName = null; } if (preg_match("#(.+?)\\/#", $SquidGuardServerName)) { $SquidGuardServerName = $re[1]; } if (preg_match("#^\\/(.+)#", $SquidGuardServerName)) { $SquidGuardServerName = $re[1]; } $SquidGuardServerName = str_replace("/", "", $SquidGuardServerName); $html = "<div style='width:98%' class=form>\n\t<div class=explain style='font-size:18px'>{servername_squidguard_explain}</div>\n\t<table style='width:100%'>\n\t" . Field_text_table("servername_squidguard-{$t}", "{hostname}", $SquidGuardServerName, 35, null, 450) . Field_button_table_autonome("{apply}", "Save{$t}()", 35) . "</table>\t\n\t</div>\n<script>\nvar xSave{$t}=function(obj){\n\t\tYahooWin5Hide();\n\t\tRefreshTab('main_dansguardian_mainrules');\n\t \tLoadjs('dansguardian2.compile.php');\n}\n\nfunction Save{$t}(){\n var XHR = new XHRConnection();\n\t XHR.appendData('servername_squidguard',document.getElementById('servername_squidguard-{$t}').value);\n XHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \t\n}\n</script>\t\t\t\n"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $t = time(); $SquidEnableParentNTLM = intval($sock->GET_INFO("SquidEnableParentNTLM")); $SquidParentNTLMPort = intval($sock->GET_INFO("SquidParentNTLMPort")); $SquidParentNTLMProxy = $sock->GET_INFO("SquidParentNTLMProxy"); $SquidParentNTLMProxyPort = intval($sock->GET_INFO("SquidParentNTLMProxyPort")); $SquidParentNTLMUsername = intval($sock->GET_INFO("SquidParentNTLMUsername")); $SquidParentNTLMPassword = intval($sock->GET_INFO("SquidParentNTLMPassword")); $SquidParentSayHostname = $sock->GET_INFO("SquidParentSayHostname"); if ($SquidParentNTLMProxyPort == 0) { $SquidParentNTLMProxyPort = 8080; } if ($SquidParentNTLMPort == 0) { $SquidParentNTLMPort = rand(8080, 9090); } if ($SquidParentSayHostname == null) { $SquidParentSayHostname = $sock->getFrameWork("cmd.php?full-hostname=yes"); } $p = Paragraphe_switch_img("{SquidEnableParentNTLM}", "{SquidEnableParentNTLM_text}", "SquidEnableParentNTLM-{$t}", $SquidEnableParentNTLM, null, 750); $html = "<table style='width:100%' class=form>\n<tr>\n\t<td valign='top' style=width:240px'><div id='parent-ntlm-status'></div>\n\t" . imgtootltip("refresh-32.png", null, "RefreshServ{$t}()", null) . "\n\t\n\t</td>\n\t<td valign='top' style='width:90%'>\n\t{$p}\n\t<table style='width:100%'>\n\t" . Field_text_table("SquidParentNTLMPort", "{local_listen_port}", $SquidParentNTLMPort, 22, null, 150) . Field_text_table("SquidParentSayHostname", "{hostname}", $SquidParentSayHostname, 22, null, 450) . Field_text_table("SquidParentNTLMProxy", "{remote_proxy}", $SquidParentNTLMProxy, 22, null, 450) . Field_text_table("SquidParentNTLMProxyPort", "{remote_port}", $SquidParentNTLMProxyPort, 22, null, 150) . Field_button_table_autonome("{apply}", "Save{$t}()", 36) . "</table>\n\t</td>\n</tr>\n</table>\n<script>\n\nfunction RefreshServ{$t}(){\n\tLoadAjax('parent-ntlm-status','{$page}?parent-ntlm-status=yes');\n}\n\nvar xSave{$t}= function (obj) {\n\tLoadjs('squid.restart.php?onlySquid=yes&onlyreload=yes&ApplyConfToo=yes&ask=yes',true);\n\tRefreshTab('main_squid_prents_tabs');\n}\t\t\t\n\t\t\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('SquidEnableParentNTLM',document.getElementById('SquidEnableParentNTLM-{$t}').value);\n\tXHR.appendData('SquidParentNTLMPort',document.getElementById('SquidParentNTLMPort').value);\n\tXHR.appendData('SquidParentNTLMProxy',document.getElementById('SquidParentNTLMProxy').value);\n\tXHR.appendData('SquidParentNTLMProxyPort',document.getElementById('SquidParentNTLMProxyPort').value);\n\tXHR.appendData('SquidParentSayHostname',document.getElementById('SquidParentSayHostname').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n}\nRefreshServ{$t}();\n</script>\t \t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function page() { $ID = intval($_GET["ID"]); $tpl = new templates(); $page = CurrentPageName(); $fields_size = 22; $rv = new squid_reverse(); $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $servername = $_GET["servername"]; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_www WHERE servername='{$servername}'")); $cache_peer_id = $ligne["cache_peer_id"]; $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT cacheid FROM reverse_sources WHERE ID='{$cache_peer_id}'")); if (intval($ligne2) == 0) { echo FATAL_ERROR_SHOW_128("{nginx_error_no_cache_defined}"); return; } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = "<tr><td colspan=2 style='font-size:40px;padding-bottom:20px'>{caching}</td></tr>"; $html[] = Field_checkbox_table("proxy_buffering-{$t}", "{proxy_buffering}", $ligne["proxy_buffering"], $fields_size, "{proxy_buffering_text}"); $html[] = Field_text_table("proxy_cache_min_uses-{$t}", "{proxy_cache_min_uses}", $ligne["proxy_cache_min_uses"], $fields_size, "{proxy_cache_min_uses_text}", 120); $html[] = Field_text_table("proxy_cache_valid-{$t}", "{proxy_cache_valid} ({minutes})", $ligne["proxy_cache_valid"], $fields_size, "{proxy_cache_valid_text}", 120); $html[] = Field_ipv4_table("proxy_buffers-{$t}", "{proxy_buffers}", $ligne["proxy_buffers"], $fields_size, "{proxy_buffers_text}", 120); $html[] = Field_text_table("proxy_buffer_size-{$t}", "{proxy_buffer_size} (k)", $ligne["proxy_buffer_size"], $fields_size, "{proxy_buffer_size_text}", 110); $html[] = Field_text_table("proxy_temp_file_write_size-{$t}", "{proxy_temp_file_write_size} (k)", $ligne["proxy_temp_file_write_size"], $fields_size, "{proxy_temp_file_write_size_text}", 110); $html[] = Field_text_table("proxy_max_temp_file_size-{$t}", "{proxy_max_temp_file_size} (MB)", $ligne["proxy_max_temp_file_size"], $fields_size, "{proxy_max_temp_file_size_text}", 110); $html[] = Field_button_table_autonome("{apply}", "Submit{$t}", 40); $html[] = "</table>"; $html[] = "</div>\n\t<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tRefreshTab('main_nginx_server');\n\t\t\$('#NGINX_MAIN_TABLE').flexReload();\n\t\t\$('#NGINX_DESTINATION_MAIN_TABLE').flexReload();\n\t\tvar ID={$ID}\n\t\tif(ID==0){ YahooWin2Hide();}\n\t\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar proxy_buffering=0\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('general-settings','{$servername}');\n\t\tif(document.getElementById('proxy_buffering-{$t}').checked){proxy_buffering=1;}\n\t\tXHR.appendData('proxy_cache_min_uses',document.getElementById('proxy_cache_min_uses-{$t}').value);\n\t\tXHR.appendData('proxy_buffering',proxy_buffering);\n\t\tXHR.appendData('proxy_cache_valid',document.getElementById('proxy_cache_valid-{$t}').value);\n\t\tXHR.appendData('proxy_buffers',document.getElementById('proxy_buffers-{$t}').value);\n\t\tXHR.appendData('proxy_buffer_size',document.getElementById('proxy_buffer_size-{$t}').value);\n\t\t\n\t\tXHR.appendData('proxy_max_temp_file_size',document.getElementById('proxy_max_temp_file_size-{$t}').value);\n\t\tXHR.appendData('proxy_temp_file_write_size',document.getElementById('proxy_temp_file_write_size-{$t}').value);\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function new_member() { $tpl = new templates(); $page = CurrentPageName(); $t = time(); $html = "<div style='width:98%' class=form>\n\t<div class=explain style='font-size:16px'>{sshd_AllowUsers_explain}</div>\n\t<table style='width:100%'>\n\t\t\t\n\t" . Field_text_table("username-{$t}", "{user2}", null, 22, null, 450) . Field_text_table("domain-{$t}", "{domain}", null, 22, null, 450) . Field_button_table_autonome("{add}", "Save{$t}", 26) . "</table>\n\t<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\t\n\t\tif (res.length>3){\n\t\t\talert(res);\n\t\t\treturn;\n\t\t}\n\t\t\$('#SSHD_ALLOW_TABLE').flexReload();\n\t\tYahooWinHide();\n\t\t\n\t}\t\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('username',encodeURIComponent(document.getElementById('username-{$t}').value));\n\t\tXHR.appendData('domain',encodeURIComponent(document.getElementById('domain-{$t}').value));\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n</script>\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function login() { $page = CurrentPageName(); $tpl = new templates(); $failed = $tpl->javascript_parse_text("{failed}"); $t = time(); $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t" . Field_text_table("username-{$t}", "{username}", null, 26, "script:SaveCheck{$t}(event)", 400) . Field_password_table("password-{$t}", "{password}", null, 26, "script:SaveCheck{$t}(event)", 400) . Field_button_table_autonome("{submit}", "Save{$t}", 32) . "\n\t\t\t\n\t\t\t\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length==0){alert('FATAL ERROR');return;};\n\tif(results=='FALSE'){\n\t\talert('{$failed}');\n\t\treturn;\n\t}\n\tAjaxTopMenu('template-top-menus','admin.top.menus.php');\n\tYahooWinBrowseHide();\n}\n\nfunction SaveCheck{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar pp=encodeURIComponent(document.getElementById('password-{$t}').value);\n\tXHR.appendData('artica_password',pp);\n\tXHR.appendData('artica_username',document.getElementById('username-{$t}').value);\n\tXHR.appendData('VIA_API','1');\n\tXHR.sendAndLoad('logon.php', 'POST',xSave{$t});\n}\n</script>\n"; echo $tpl->_ENGINE_parse_body($html); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $squid_reverse = new squid_reverse(); $sslcertificates = $squid_reverse->ssl_certificates_list(); $you_need_to_compile = $tpl->javascript_parse_text("{you_need_to_compile}"); $servername = $_GET["servername"]; $q = new mysql_squid_builder(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_www WHERE servername='{$servername}'")); if (!is_numeric($ligne["ssl_backend_port"])) { $ligne["ssl_backend_port"] = 443; } $t = time(); $ssl_use_rcert = 0; $to = null; $AS_PEER_CERTIFICATE = 0; $AS_PEER_CERTIFICATE_EXPLAIN = null; $cache_peer_id = $ligne["cache_peer_id"]; if ($cache_peer_id > 0) { if (!$q->FIELD_EXISTS("reverse_sources", "ssl_remotecert")) { $q->QUERY_SQL("ALTER TABLE `reverse_sources` ADD `ssl_remotecert` smallint(1) NOT NULL DEFAULT '0'"); if (!$q->ok) { echo $q->mysql_error_html(); } } $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT servername,ssl_remotecert FROM reverse_sources WHERE ID='{$cache_peer_id}'")); if (!$q->ok) { echo $q->mysql_error_html(); } $to = " {to} «{$ligne2["servername"]}»"; } if (intval($cache_peer_id) > 0) { $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT certificate FROM reverse_sources WHERE ID='{$cache_peer_id}'")); if (trim($ligne2["certificate"] != null)) { $ligne["certificate"] = $ligne2["certificate"]; $AS_PEER_CERTIFICATE = 1; } } if ($AS_PEER_CERTIFICATE == 1) { $AS_PEER_CERTIFICATE_EXPLAIN = "<div class=text-info>{reverse_proxy_use_destination_server_certificate}</div>"; } $html[] = "<div style='width:98%' class=form>{$AS_PEER_CERTIFICATE_EXPLAIN}"; $html[] = "<table style='width:100%'>"; $html[] = "<tr><td colspan=2 style='font-size:28px;padding-bottom:20px'>{port}:{$ligne["port"]} «{$servername}»{$to}</td></tr>"; $html[] = "<tr><td colspan=2>" . Paragraphe_switch_img("{reverse_proxy_ssl}", "{NGINX_USE_SSL_EXPLAIN}", "ssl-{$t}", $ligne["ssl"], null, 700, "SwitchOffCertificate{$t}") . "</td></tr>"; $html[] = Field_list_table("certificate-{$t}", "{certificate}", $ligne["certificate"], 22, $sslcertificates, null, 450); if ($cache_peer_id > 0) { $html[] = "<tr><td colspan=2>" . Paragraphe_switch_img("{destination_use_ssl}", "{NGINX_USE_SSL_EXPLAIN2}", "ssl_backend-{$t}", $ligne["ssl_backend"], null, 700) . "</td></tr>"; $html[] = "<tr><td colspan=2>" . Paragraphe_switch_img("{SSL_CLIENT_VERIFICATION}", "{SSL_CLIENT_VERIFICATION_EXPLAIN}", "ssl_client_certificate-{$t}", $ligne["ssl_client_certificate"], null, 700) . "</td></tr>"; } $html[] = Field_button_table_autonome("{apply}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#NGINX_MAIN_TABLE').flexReload();\n\talert('{$you_need_to_compile}');\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar AS_PEER_CERTIFICATE={$AS_PEER_CERTIFICATE};\n\tXHR.appendData('servername','{$servername}');\n\tXHR.appendData('cache_peer_id','{$cache_peer_id}');\n\tXHR.appendData('ssl',document.getElementById('ssl-{$t}').value);\n\tif(document.getElementById('ssl_backend-{$t}')){\n\t\tXHR.appendData('ssl_backend',document.getElementById('ssl_backend-{$t}').value);\n\t}\n\tif(document.getElementById('ssl_client_certificate-{$t}')){\n\t\tXHR.appendData('ssl_client_certificate',document.getElementById('ssl_client_certificate-{$t}').value);\n\t}\t\n\t\n\t\n\t\n\tXHR.appendData('certificate',document.getElementById('certificate-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n\nfunction SwitchOffCertificate{$t}(){\n\tvar ssl=document.getElementById('ssl-{$t}').value;\n\t\n}\n\nfunction Check{$t}(){\n\tvar AS_PEER_CERTIFICATE={$AS_PEER_CERTIFICATE};\n\tif( AS_PEER_CERTIFICATE==1){\n\t\tdocument.getElementById('certificate-{$t}').disabled=true;\n\t}\n\tSwitchOffCertificate{$t}();\n}\nCheck{$t}();\n</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function popup(){ $page=CurrentPageName(); $sock=new sockets(); $users=new usersMenus(); $t=time(); $SquidGuardIPWeb=$sock->GET_INFO("SquidGuardIPWeb"); $fulluri=$sock->GET_INFO("SquidGuardIPWeb"); $SquidGuardServerName=$sock->GET_INFO("SquidGuardServerName"); if(preg_match("#\/(.+?):([0-9]+)\/#",$SquidGuardIPWeb,$re)){$SquidGuardIPWeb="{$re[1]}:{$re[2]}";} if(preg_match("#(.+?):([0-9]+)#",$SquidGuardIPWeb,$re)){ $SquidGuardServerName=$re[1]; $SquidGuardApachePort=$re[2]; } if($SquidGuardServerName=="/"){$SquidGuardServerName=null;} $html="<div style='width:98%' class=form> <table style='width:100%'> ". Field_ipv4_table("servername_squidguard-$t", "{ipaddr}",$SquidGuardServerName,35). Field_button_table_autonome("{apply}", "Save$t()",35)."</table> </div> <script> var xSave$t=function(obj){ YahooWin5Hide(); RefreshTab('main_dansguardian_mainrules'); Loadjs('dansguardian2.compile.php'); } function Save$t(){ var XHR = new XHRConnection(); XHR.appendData('servername_squidguard',document.getElementById('servername_squidguard-$t').value); XHR.sendAndLoad('$page', 'POST',xSave$t); } </script> "; $tpl=new templates(); echo $tpl->_ENGINE_parse_body($html); }
function new_member(){ $tpl=new templates(); $page=CurrentPageName(); $t=time(); $html="<div style='width:98%' class=form> <div class=text-info style='font-size:16px'>{sshd_AllowUsers_explain}</div> <table style='width:100%'> ".Field_text_table("username-$t", "{user2}",null,22,null,450). Field_text_table("domain-$t", "{domain}",null,22,null,450). Field_button_table_autonome("{add}", "Save$t",26). "</table> <script> var xSave$t= function (obj) { var res=obj.responseText; if (res.length>3){ alert(res); return; } $('#SSHD_ALLOW_TABLE').flexReload(); YahooWinHide(); } function Save$t(){ var XHR = new XHRConnection(); XHR.appendData('username',encodeURIComponent(document.getElementById('username-$t').value)); XHR.appendData('domain',encodeURIComponent(document.getElementById('domain-$t').value)); XHR.sendAndLoad('$page', 'POST',xSave$t); } </script> "; echo $tpl->_ENGINE_parse_body($html); }
function websites_popup_webserver_replace_popup() { $tpl = new templates(); $page = CurrentPageName(); $servername = $_GET["servername"]; $q = new mysql_squid_builder(); $title = "{new_rule}"; $bt = "{add}"; $ID = intval($_GET["replaceid"]); $boot = new boostrap_form(); $sock = new sockets(); $servername = $_GET["servername"]; $t = time(); $fields_size = 22; if ($ID > 0) { $q = new mysql_squid_builder(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_replace_www WHERE ID='{$ID}'")); $bt = "{apply}"; $title = "{$ligne["rulename"]}"; $ligne["stringtosearch"] = stripslashes($ligne["stringtosearch"]); $ligne["replaceby"] = stripslashes($ligne["replaceby"]); $servername = $ligne["servername"]; } if ($ligne["tokens"] == null) { $ligne["tokens"] = "gir"; } if ($ligne["rulename"] == null) { $ligne["rulename"] = time(); } $html[] = "<div style='width:98%' class=form><div style='font-size:30px;margin-bottom:20px'>{$title}</div>\n\t<div class=explain style='font-size:18px'>{nginx_subst_explain}</div>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("rulename-{$t}", "{rulename}", $ligne["rulename"], $fields_size, null, 450); $html[] = Field_text_table("zorder-{$t}", "{order}", intval($ligne["zorder"]), $fields_size, null, 110); $html[] = Field_area_table("stringtosearch-{$t}", "{search}", $ligne["stringtosearch"], $fields_size, null, 145); $html[] = Field_checkbox_table("AsRegex-{$t}", "{regex}", $ligne["AsRegex"], $fields_size, "{replace_regex_explain}"); $html[] = Field_area_table("replaceby-{$t}", "{replace}", $ligne["replaceby"], $fields_size, null, 145); $html[] = Field_text_table("tokens-{$t}", "{flags}", $ligne["tokens"], $fields_size, null); $html[] = Field_button_table_autonome($bt, "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\n\tvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\t\$('#NGINX_MAIN_TABLE').flexReload();\n\t\$('#NGINX_REPLACE_RULES').flexReload();\n\tvar ID={$ID}\n\tif(ID==0){ YahooWin3Hide();}\n\t\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar AsRegex=0\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('replaceid','{$ID}');\n\tif(document.getElementById('AsRegex-{$t}').checked){AsRegex=1;}\n\tXHR.appendData('servername','{$servername}');\n\tXHR.appendData('rulename',encodeURIComponent(document.getElementById('rulename-{$t}').value));\n\tXHR.appendData('zorder',document.getElementById('zorder-{$t}').value);\n\tXHR.appendData('stringtosearch',encodeURIComponent(document.getElementById('stringtosearch-{$t}').value));\n\tXHR.appendData('replaceby',encodeURIComponent(document.getElementById('replaceby-{$t}').value));\n\tXHR.appendData('AsRegex',AsRegex);\n\tXHR.appendData('tokens',document.getElementById('tokens-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function rule_popup() { $ID = intval($_GET["ID"]); $tpl = new templates(); $page = CurrentPageName(); $fields_size = 22; $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $bt = "{add}"; if ($ID > 0) { $bt = "{apply}"; } $Timez[1] = "{by_hour}"; $Timez[2] = "{by_day}"; $Timez[3] = "{by_week}"; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM webfilter_quotas WHERE ID='{$ID}'")); if (!$q->ok) { echo FATAL_ERROR_SHOW_128($q->mysql_error); return; } $Timez[0] = "{by_hour}"; if (!is_numeric($ligne["quotasize"])) { $ligne["quotasize"] = 250; } if (!is_numeric($ligne["quotaPeriod"])) { $ligne["quotaPeriod"] = 1; } if ($ligne["groupname"] == null) { $ligne["groupname"] = $tpl->javascript_parse_text("{new_rule}"); $ligne["enabled"] = 1; $ligne["zOrder"] = 0; } $html[] = "<div style='width:98%;font-size:28px;margin-bottom:20px'>{rule}: ({$ID}) {$ligne["groupname"]}</div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("groupname-{$t}", "{rulename}", $ligne["groupname"], $fields_size, null, 450); $html[] = Field_checkbox_table("enabled-{$t}", "{enabled}", $ligne["enabled"], $fields_size, null, "CheckEnabled{$t}()"); $html[] = Field_text_table("zorder-{$t}", "{order}", $ligne["zOrder"], $fields_size, null, 110); $html[] = Field_text_table("quotasize-{$t}", "{max_size} MB", $ligne["quotasize"], $fields_size, null, 110); $html[] = Field_list_table("quotaPeriod-{$t}", "{period}", $ligne["quotaPeriod"], $fields_size, $Timez, null, 450); $html[] = Field_checkbox_table("AllSystems-{$t}", "{AllSystems}", $ligne["AllSystems"], $fields_size, null, "blur()"); $html[] = Field_checkbox_table("UseExternalWebPage-{$t}", "{UseExternalWebPage}", $ligne["UseExternalWebPage"], $fields_size, null, "UnCheckUseExternalWebPage{$t}()"); $html[] = Field_text_table("ExternalWebPage-{$t}", "{ExternalWebPage}", $ligne["ExternalWebPage"], $fields_size, null, 450); $html[] = Field_button_table_autonome($bt, "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#SQUID_ARTICA_QUOTA_RULES').flexReload();\n\tvar ID='{$ID}';\n\tif(ID==0){ YahooWin3Hide();return;}\n\tRefreshTab('main_quota_rule_{$ID}');\n}\n\t\n\n\t\nfunction UnCheckUseExternalWebPage{$t}(){\n\tif(!document.getElementById('enabled-{$t}').checked){return;}\n\tif(document.getElementById('UseExternalWebPage-{$t}').checked){\n\t\tdocument.getElementById('ExternalWebPage-{$t}').disabled=false;\n\t}else{\n\t\tdocument.getElementById('ExternalWebPage-{$t}').disabled=true;\n\t}\n}\n\nfunction CheckEnabled{$t}(){\n\tdocument.getElementById('ExternalWebPage-{$t}').disabled=true;\n\tdocument.getElementById('UseExternalWebPage-{$t}').disabled=true;\n\tdocument.getElementById('groupname-{$t}').disabled=true;\n\tdocument.getElementById('zorder-{$t}').disabled=true;\n\tdocument.getElementById('quotasize-{$t}').disabled=true;\n\tdocument.getElementById('quotaPeriod-{$t}').disabled=true;\n\tdocument.getElementById('AllSystems-{$t}').disabled=true;\n\tif(document.getElementById('enabled-{$t}').checked){\n\t\tdocument.getElementById('ExternalWebPage-{$t}').disabled=false;\n\t\tdocument.getElementById('UseExternalWebPage-{$t}').disabled=false;\n\t\tdocument.getElementById('groupname-{$t}').disabled=false;\n\t\tdocument.getElementById('quotasize-{$t}').disabled=false;\n\t\tdocument.getElementById('quotaPeriod-{$t}').disabled=false;\n\t\tdocument.getElementById('AllSystems-{$t}').disabled=false;\n\t\tdocument.getElementById('zorder-{$t}').disabled=false;\n\t}\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ID','{$ID}');\n\tXHR.appendData('groupname',encodeURIComponent(document.getElementById('groupname-{$t}').value));\n\tXHR.appendData('quotasize',document.getElementById('quotasize-{$t}').value);\n\tXHR.appendData('quotaPeriod',document.getElementById('quotaPeriod-{$t}').value);\n\tXHR.appendData('ExternalWebPage',encodeURIComponent(document.getElementById('ExternalWebPage-{$t}').value));\n\tXHR.appendData('zorder',document.getElementById('zorder-{$t}').value);\n\tif(document.getElementById('AllSystems-{$t}').checked){XHR.appendData('AllSystems','1');}else{XHR.appendData('AllSystems','0');}\n\tif(document.getElementById('enabled-{$t}').checked){XHR.appendData('enabled','1');}else{XHR.appendData('enabled','0');}\n\tif(document.getElementById('UseExternalWebPage-{$t}').checked){XHR.appendData('UseExternalWebPage','1');}else{XHR.appendData('UseExternalWebPage','0');}\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n\t\n\tUnCheckUseExternalWebPage{$t}();\n\tCheckEnabled{$t}();\n</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function group_popup() { $ID = $_GET["ID"]; $q = new mysql_squid_builder(); $page = CurrentPageName(); $tpl = new templates(); $title = "{new_group}"; $bt = "{add}"; $t = time(); if (!$q->TABLE_EXISTS("nginx_exploits_groups")) { $sql = "CREATE TABLE IF NOT EXISTS `nginx_exploits_groups` (\n\t\t\t `ID` INT NOT NULL AUTO_INCREMENT,\n\t\t\t `groupname` CHAR(255) NOT NULL,\n\t\t\t PRIMARY KEY (`ID`),\n\t\t\t KEY `groupname` (`groupname`)\n\t\t\t) ENGINE = MYISAM;"; if (!$q->QUERY_SQL($sql)) { echo $q->mysql_error_html(); } } $sock = new sockets(); if ($ID > 0) { $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_exploits_groups WHERE ID='{$ID}'")); $bt = "{apply}"; $title = utf8_encode("{$ligne["groupname"]}"); } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = "<tr style='height:75px'><td colspan=2 style='font-size:36px;margin-bottom:40px'>{$title}</td></tr>"; $html[] = Field_checkbox_table("addef-{$t}", "{add_defaults}", 0, 26); $html[] = Field_text_table("groupname-{$t}", "{groupname}", $ligne["groupname"], 26, null, 450); $html[] = Field_button_table_autonome($bt, "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_ANTI_EXPLOITS').flexReload();\n\t\tvar ID={$ID};\n\t\tif(ID==0){ YahooWin5Hide();}\n\t\t\n\t}\n\n\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('editgroupid','{$ID}');\n\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\tXHR.appendData('groupname',encodeURIComponent(document.getElementById('groupname-{$t}').value));\n\t\tif(document.getElementById('addef-{$t}').checked){ XHR.appendData('addef',1); }else{ XHR.appendData('addef',0); }\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\t\n\t}\n</script>"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function rule_parameters() { $ID = $_GET["ID"]; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM artica_caches WHERE ID='{$ID}'", "artica_backup")); $t = time(); if ($ligne["MaxSizeBytes"] == 0) { $ligne["MaxSizeBytes"] = 3145728000; } $ligne["MaxSizeBytes"] = $ligne["MaxSizeBytes"] / 1024; $ligne["MaxSizeBytes"] = $ligne["MaxSizeBytes"] / 1024; $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>" . Field_checkbox_table("enabled-{$t}", "{enabled}", $ligne["enabled"]) . Field_text_table("rulename-{$t}", "{rulename}", $ligne["rulename"], 18, null, 250) . Field_text_table("sitename-{$t}", "{sitename}", $ligne["sitename"], 18, null, 250) . Field_text_table("MaxSizeBytes-{$t}", "{max_size} MB", $ligne["MaxSizeBytes"], 18, null, 250) . Field_button_table_autonome("{apply}", "Save{$t}", 26) . "\n\t</table>\n</div>\t\t\n<script>\nvar xSave{$t}=function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\t\$('#squid_enforce_rules_table').flexReload();\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar EnableSquidCacheBoosters=0;\n\tif(document.getElementById('enabled-{$t}').checked){\n\tXHR.appendData('enabled',1);\n\t}else{XHR.appendData('enabled',0);}\n\t\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tXHR.appendData('MaxSizeBytes',document.getElementById('MaxSizeBytes-{$t}').value)\n\tXHR.appendData('rulename',encodeURIComponent(document.getElementById('rulename-{$t}').value));\n\tXHR.appendData('sitename',encodeURIComponent(document.getElementById('rulename-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\t\t\t\t\t\n}\n</script>\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function cache_popup() { $tpl = new templates(); $page = CurrentPageName(); $servername = $_GET["servername"]; $q = new mysql_squid_builder(); $title = "{new_cache}"; $bt = "{add}"; $ID = $_GET["ID"]; $sock = new sockets(); $t = time(); if (!is_numeric($ID)) { $ID = 0; } $NginxProxyStorePath = $sock->GET_INFO("NginxProxyStorePath"); if ($NginxProxyStorePath == null) { $NginxProxyStorePath = "/home/nginx"; } if ($ID > 0) { $q = new mysql_squid_builder(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_caches WHERE ID='{$ID}'")); $bt = "{apply}"; $title = "{$ligne["keys_zone"]}"; } if ($ligne["keys_zone"] == null) { $ligne["keys_zone"] = time(); } if (trim($ligne["directory"]) == null) { $ligne["directory"] = $NginxProxyStorePath . "/{$ligne["keys_zone"]}"; } if ($ligne["levels"] == null) { $ligne["levels"] = "1:2"; } if (!is_numeric($ligne["keys_zone_size"])) { $ligne["keys_zone_size"] = 1; } if (!is_numeric($ligne["max_size"])) { $ligne["max_size"] = 2; } if (!is_numeric($ligne["inactive"])) { $ligne["inactive"] = 10; } if (!is_numeric($ligne["loader_files"])) { $ligne["loader_files"] = 100; } if (!is_numeric($ligne["loader_sleep"])) { $ligne["loader_sleep"] = 10; } if (!is_numeric($ligne["loader_threshold"])) { $ligne["loader_threshold"] = 100; } $fontsize = 22; $html[] = "<div style='width:100%;font-size:28px;margin-bottom:20px'>{$title}</div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("keys_zone-{$t}", "{name}", $ligne["keys_zone"], $fontsize, null, 450); $html[] = Field_text_table("directory-{$t}", "{directory}", $ligne["directory"], $fontsize, null, 450); $html[] = Field_text_table("levels-{$t}", "{levels}", $ligne["levels"], $fontsize, null, 110); $html[] = Field_text_table("keys_zone_size-{$t}", "{memory_size} (MB)", $ligne["keys_zone_size"], $fontsize, null, 110); $html[] = Field_text_table("max_size-{$t}", "{max_size} (GB)", $ligne["max_size"], $fontsize, null, 110); $html[] = Field_text_table("inactive-{$t}", "{inactive} ({minutes})", $ligne["inactive"], $fontsize, "{nginx_inactive_explain}", 110); $html[] = Field_text_table("loader_files-{$t}", "{loader_files}", $ligne["loader_files"], $fontsize, null, 110); $html[] = Field_text_table("loader_sleep-{$t}", "{loader_sleep} {milliseconds}", $ligne["loader_sleep"], $fontsize, null, 110); $html[] = Field_text_table("loader_threshold-{$t}", "{loader_threshold} {milliseconds}", $ligne["loader_threshold"], $fontsize, null, 110); $html[] = Field_button_table_autonome($bt, "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tvar ID={$ID};\n\tif(results.length>3){alert(results);}\n\t\$('#NGINX_CACHE_TABLE').flexReload();\n\tif(ID==0){ YahooWin4Hide();}\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('save-cache','{$ID}');\n\tXHR.appendData('ID','{$ID}');\n\tXHR.appendData('keys_zone',document.getElementById('keys_zone-{$t}').value);\n\tXHR.appendData('directory',document.getElementById('directory-{$t}').value);\n\tXHR.appendData('levels',document.getElementById('levels-{$t}').value);\n\tXHR.appendData('keys_zone_size',document.getElementById('keys_zone_size-{$t}').value);\n\tXHR.appendData('max_size',document.getElementById('max_size-{$t}').value);\n\tXHR.appendData('inactive',document.getElementById('inactive-{$t}').value);\n\tXHR.appendData('loader_files',document.getElementById('loader_files-{$t}').value);\n\tXHR.appendData('loader_sleep',document.getElementById('loader_sleep-{$t}').value);\n\tXHR.appendData('loader_threshold',document.getElementById('loader_threshold-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function general_settings() { $ID = $_GET["ID"]; $tpl = new templates(); $page = CurrentPageName(); $fields_size = 22; $rv = new squid_reverse(); $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $sslcertificates = $rv->ssl_certificates_list(); $sslcertificates[null] = "{none}"; $results = $q->QUERY_SQL("SELECT ID,keys_zone FROM nginx_caches ORDER BY keys_zone LIMIT 0,250"); $nginx_caches[0] = "{none}"; while ($ligne2 = mysql_fetch_array($results, MYSQL_ASSOC)) { $nginx_caches[$ligne2["ID"]] = $ligne2["keys_zone"]; } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_sources WHERE ID='{$ID}'")); if (!$q->ok) { echo FATAL_ERROR_SHOW_128($q->mysql_error); return; } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = "<tr><td colspan=2 style='font-size:28px;padding-bottom:20px'>{main_parameters} {$ligne["ipaddr"]}:{$ligne["port"]}</td></tr>"; $html[] = Field_text_table("servername-{$t}", "{name}", $ligne["servername"], $fields_size, null, 450); $html[] = Field_ipv4_table("ipaddr-{$t}", "{ipaddr}", $ligne["ipaddr"], $fields_size, null, 110); $html[] = Field_text_table("port-{$t}", "{inbound_port}", $ligne["port"], $fields_size, null, 110); $html[] = Field_text_table("forceddomain-{$t}", "{forceddomain}", $ligne["forceddomain"], $fields_size, null, 450); $html[] = Field_text_table("remote_path-{$t}", "{root_directory}", $ligne["remote_path"], $fields_size, null, 450); $html[] = Field_list_table("cacheid-{$t}", "{cache_directory}", $ligne["cacheid"], $fields_size, $nginx_caches, null, 450); $html[] = Field_list_table("certificate-{$t}", "{certificate}", $ligne["certificate"], $fields_size, $sslcertificates, null, 450); $html[] = Field_button_table_autonome("{apply}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n\t<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\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('general-settings','{$ID}');\n\t\tXHR.appendData('servername',document.getElementById('servername-{$t}').value);\n\t\tXHR.appendData('ipaddr',document.getElementById('ipaddr-{$t}').value);\n\t\tXHR.appendData('port',document.getElementById('port-{$t}').value);\n\t\tXHR.appendData('forceddomain',document.getElementById('forceddomain-{$t}').value);\n\t\tvar pp=encodeURIComponent(document.getElementById('remote_path-{$t}').value);\n\t\tXHR.appendData('remote_path',document.getElementById('remote_path-{$t}').value);\n\t\tXHR.appendData('cacheid',document.getElementById('cacheid-{$t}').value);\n\t\tXHR.appendData('certificate',document.getElementById('certificate-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function certificate_edit_settings() { $commonName = $_GET["CommonName"]; $commonNameADD = null; $q = new mysql(); $db = file_get_contents(dirname(__FILE__) . '/ressources/databases/ISO-3166-Codes-Countries.txt'); $tbl = explode("\n", $db); while (list($num, $ligne) = each($tbl)) { if (preg_match('#(.+?);\\s+([A-Z]{1,2})#', $ligne, $regs)) { $regs[2] = trim($regs[2]); $regs[1] = trim($regs[1]); $array_country_codes["{$regs[1]}_{$regs[2]}"] = $regs[1]; } } $ENC[1024] = 1024; $ENC[2048] = 2048; $ENC[4096] = 4096; if (!$q->FIELD_EXISTS("sslcertificates", "UsePrivKeyCrt", "artica_backup")) { $sql = "ALTER TABLE `sslcertificates` ADD `UsePrivKeyCrt` smallint(1) DEFAULT 0"; $q->QUERY_SQL($sql, 'artica_backup'); } $tpl = new templates(); $choose_UsePrivKeyCrt = $tpl->javascript_parse_text("{choose_UsePrivKeyCrt}"); $sql = "SELECT * FROM sslcertificates WHERE CommonName='{$commonName}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if ($ligne["UseGodaddy"] == 1) { $ligne["UsePrivKeyCrt"] = 1; $commonNameADD = " (Godaddy)"; } if ($ligne["UsePrivKeyCrt"] == 0) { if ($ligne["CountryName"] == null) { $ligne["CountryName"] = "UNITED STATES_US"; } if ($ligne["stateOrProvinceName"] == null) { $ligne["stateOrProvinceName"] = "New York"; } if ($ligne["localityName"] == null) { $ligne["localityName"] = "Brooklyn"; } if ($ligne["emailAddress"] == null) { $ligne["emailAddress"] = "*****@*****.**"; } if ($ligne["OrganizationName"] == null) { $ligne["OrganizationName"] = "MyCompany Ltd"; } if ($ligne["OrganizationalUnit"] == null) { $ligne["OrganizationalUnit"] = "IT service"; } if (!is_numeric($ligne["CertificateMaxDays"])) { $ligne["CertificateMaxDays"] = 730; } if (!is_numeric($ligne["levelenc"])) { $ligne["levelenc"] = 1024; } } $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $hostname = $sock->GET_INFO("myhostname"); $choose_UsePrivKeyCrt = $tpl->javascript_parse_text("{choose_UsePrivKeyCrt}"); $t = time(); $ENC[1024] = 1024; $ENC[2048] = 2048; $ENC[4096] = 4096; $commonNameEnc = urlencode($commonName); $bt_name = "{apply}"; if (strlen($ligne["pkcs12"]) > 50) { $cleint_certificate = "<div style='float:right;width:30%;text-align:right;margin:5px'>\n\t\t\t<center>\n\t\t\t<a href=\"{$page}?pkcs12=yes&CommonName=" . urlencode($_GET["CommonName"]) . "\">\n\t\t\t\t<img src='img/certificate-128.png'>\n\t\t\t</a><br>\n\t\t\t<span style='font-size:18px'>PKCS12 {client_certificate}</span> \n\t\t\t</center>\n\t\t\t</div>"; } if ($ligne["UsePrivKeyCrt"] == 0) { $bt_name = "{generate_x509}"; } $html[] = "<div style='font-size:42px;margin-bottom:15px'>{$commonName}{$commonNameADD}</div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; if ($ligne["UsePrivKeyCrt"] == 0) { $html[] = "<tr><td colspan=2>{$cleint_certificate}" . Paragraphe_switch_img("{UsePrivKeyCrt}", "{UsePrivKeyCrt_text}", "UsePrivKeyCrt", $ligne["UsePrivKeyCrt"], null, 820) . "</td></tr>"; $html[] = Field_list_table("CountryName-{$t}", "{countryName}", $ligne["CountryName"], 22, $array_country_codes); $html[] = Field_text_table("stateOrProvinceName", "{stateOrProvinceName}", $ligne["stateOrProvinceName"], 22, null, 400); $html[] = Field_text_table("localityName", "{localityName}", $ligne["localityName"], 22, null, 400); $html[] = Field_text_table("OrganizationName", "{organizationName}", $ligne["OrganizationName"], 22, null, 400); $html[] = Field_text_table("OrganizationalUnit", "{organizationalUnitName}", $ligne["OrganizationalUnit"], 22, null, 400); $html[] = Field_text_table("emailAddress", "{emailAddress}", $ligne["emailAddress"], 22, null, 400); $html[] = Field_text_table("CertificateMaxDays", "{CertificateMaxDays} ({days})", $ligne["CertificateMaxDays"], 22, null, 150); $html[] = Field_list_table("levelenc", "{level_encryption}", $ligne["levelenc"], 22, $ENC); $html[] = Field_password_table("password-{$t}", "{password}", $ligne["password"], 22, null, 300); $html[] = Field_button_table_autonome($bt_name, "Submit{$t}", 30); } else { $html[] = "<tr>\n\t\t<td class=legend style='font-size:22px'>{countryName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["CountryName"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{stateOrProvinceName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["stateOrProvinceName"]}</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{localityName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["localityName"]}</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{organizationName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["OrganizationName"]}</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{organizationalUnitName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["OrganizationalUnit"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{emailAddress}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["emailAddress"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{level_encryption}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["levelenc"]}</td>\n\t\t</tr>\t\t"; } $html[] = "</table>"; $html[] = "</div>\n\t<script>\n\t\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#TABLE_CERTIFICATE_CENTER_MAIN').flexReload();\n\t\tvar UsePrivKeyCrt=document.getElementById('UsePrivKeyCrt').value;\n\t\tif(UsePrivKeyCrt==1){\n\t\t\tLoadjs('openssl.x509.progress.php?generate-x509={$commonNameEnc}');\n\t\t}else{\n\t\t\tLoadjs('openssl.CSR.progress.php?generate-csr={$commonNameEnc}');\n\t\t}\n\t\tYahooWin6Hide();\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tXHR.appendData('CommonName',encodeURIComponent('{$_GET["CommonName"]}'));\n\tXHR.appendData('UsePrivKeyCrt',document.getElementById('UsePrivKeyCrt').value);\n\tXHR.appendData('CountryName',document.getElementById('CountryName-{$t}').value);\n\t\n\tXHR.appendData('CertificateMaxDays',document.getElementById('CertificateMaxDays').value);\n\tXHR.appendData('stateOrProvinceName',document.getElementById('stateOrProvinceName').value);\n\tXHR.appendData('localityName',document.getElementById('localityName').value);\n\tXHR.appendData('OrganizationName',document.getElementById('OrganizationName').value);\n\tXHR.appendData('OrganizationalUnit',document.getElementById('OrganizationalUnit').value);\n\tXHR.appendData('emailAddress',document.getElementById('emailAddress').value);\n\tXHR.appendData('levelenc',document.getElementById('levelenc').value);\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\n\n\t</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function report_main() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $dans = new dansguardian_rules(); $cats = $dans->LoadBlackListes(); while (list($num, $ligne) = each($cats)) { $newcat[$num] = $num; } $newcat[null] = "{none}"; $sql = "SELECT DATE_FORMAT(zDate,'%Y-%m-%d') as tdate FROM tables_day ORDER BY zDate LIMIT 0,1"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql)); $mindate = $ligne2["tdate"]; $sql = "SELECT DATE_FORMAT(zDate,'%Y-%m-%d') as tdate FROM tables_day ORDER BY zDate DESC LIMIT 0,1"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql)); $maxdate = $ligne2["tdate"]; $ID = $_GET["ID"]; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM `squid_reports` WHERE ID='{$ID}'")); $t = time(); $report_days[0] = "{date_range}"; $report_days[2] = "2 {days}"; $report_days[7] = "1 {week}"; $report_days[15] = "2 {weeks}"; $report_days[-1] = "{current_month}"; $report_days[30] = "1 {month}"; $report_days[60] = "2 {months}"; $report_days[90] = "3 {months}"; $report_days[180] = "6 {months}"; $report_days[365] = "1 {year}"; $report_build_time_start = $ligne["report_build_time_start"]; $report_build_time_end = $ligne["report_build_time_end"]; if ($report_build_time_start == 0) { $report_build_time_start = $mindate; } else { $report_build_time_start = date("Y-m-d", $report_build_time_start); } if ($report_build_time_end == 0) { $report_build_time_end = $maxdate; } else { $report_build_time_end = date("Y-m-d", $report_build_time_end); } if ($ligne["report_name"] == null) { $ligne["report_name"] = "New report"; } $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t" . Field_text_table("report_name-{$t}", "{report}", utf8_encode($ligne["report_name"]), 18, null, 350) . Field_text_table("description-{$t}", "{description}", utf8_encode($ligne["description"]), 18, null, 350) . Field_list_table("report_type-{$t}", "{type}", $ligne["report_type"], 18, $q->report_types) . Field_list_table("report_days-{$t}", "{from_the_last_time}", $ligne["report_days"], 18, $report_days, "ReportDaysCheck()") . "<tr>\n\t\t<td style='font-size:18px' class=legend>{from_date}:</td>\n\t\t<td>" . field_date("report_build_time_start-{$t}", $report_build_time_start, "font-size:18px;padding:3px;width:120px", "mindate:{$mindate};maxdate:{$maxdate}") . "</td>\n\t</tr>\n<tr>\n\t\t<td style='font-size:18px' class=legend>{to_date}:</td>\n\t\t<td>" . field_date("report_build_time_end-{$t}", $report_build_time_end, "font-size:18px;padding:3px;width:120px", "mindate:{$mindate};maxdate:{$maxdate}") . "</td>\n\t</tr>\t\t" . Field_checkbox_table("recategorize-{$t}", "{recategorize}", $ligne["recategorize"], 18) . Field_checkbox_table("categorize-{$t}", "{categorize}", $ligne["categorize"], 18) . Field_checkbox_table("report_not_categorized-{$t}", "{report_not_categorized}", $ligne["report_not_categorized"], 18) . Field_button_table_autonome("{apply}", "Save{$t}", 26) . "</table>\n\t</div>\t\n<script>\n\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\t\n\t\tif (res.length>3){\n\t\t\talert(res);\n\t\t\treturn;\n\t\t}\n\t\t\$('#SQUID_MAIN_REPORTS').flexReload();\n\t\tRefreshTab('report_single_tab');\n\t}\t\n\t\n\tfunction ReportDaysCheck(){\n\t\tdocument.getElementById('report_build_time_start-{$t}').disabled=true;\n\t\tdocument.getElementById('report_build_time_end-{$t}').disabled=true;\n\t\tvar report_days=document.getElementById('report_days-{$t}').value;\n\t\tif(report_days==0){\n\t\t\tdocument.getElementById('report_build_time_start-{$t}').disabled=false;\n\t\t\tdocument.getElementById('report_build_time_end-{$t}').disabled=false;\t\t\n\t\t}\n\t}\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\tXHR.appendData('ID',{$ID});\n\t\tXHR.appendData('report_name',encodeURIComponent(document.getElementById('report_name-{$t}').value));\n\t\tXHR.appendData('description',encodeURIComponent(document.getElementById('description-{$t}').value));\n\t\t\n\t\tXHR.appendData('report_build_time_start',document.getElementById('report_build_time_start-{$t}').value);\n\t\tXHR.appendData('report_build_time_end',document.getElementById('report_build_time_end-{$t}').value);\n\t\t\n\t\tXHR.appendData('report_type',document.getElementById('report_type-{$t}').value);\n\t\tXHR.appendData('report_days',document.getElementById('report_days-{$t}').value);\n\t\tif(document.getElementById('recategorize-{$t}').checked){XHR.appendData('recategorize',1);}else{XHR.appendData('recategorize',0);}\n\t\tif(document.getElementById('categorize-{$t}').checked){XHR.appendData('categorize',1);}else{XHR.appendData('categorize',0);}\n\t\tif(document.getElementById('report_not_categorized-{$t}').checked){XHR.appendData('report_not_categorized',1);}else{XHR.appendData('report_not_categorized',0);}\n\t\t\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\t\nReportDaysCheck();\n</script>\n\t\t\t\n\t\t\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function group_popup() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_meta(); $ID = $_GET["ID"]; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT groupname FROM metagroups WHERE ID={$_GET["ID"]}")); $groupname = $tpl->javascript_parse_text($ligne["groupname"]); $t = time(); $html = "<div style='font-size:22px;margin-bottom:20px'> « {$groupname} »</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>" . Field_text_table("groupname-{$t}", "{groupname}", $ligne["groupname"], 22, null, 350) . Field_button_table_autonome("{apply}", "Save{$t}()", 32) . "</table>\n\t<script>\nvar xSave{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\t\$('#ARTICA_META_GROUP_TABLE').flexReload();\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('ID', '{$ID}');\n\tXHR.appendData('groupname', encodeURIComponent(document.getElementById('groupname-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function step3() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $squid = new squidbee(); $WizardProxyTransparent = unserialize($sock->GET_INFO("WizardProxyTransparent")); $connected_port = intval($WizardProxyTransparent["connected_port"]); $transparent_port = intval($WizardProxyTransparent["transparent_port"]); $transparent_ssl_port = intval($WizardProxyTransparent["transparent_ssl_port"]); $EnableSSLBump = intval($WizardProxyTransparent["EnableSSLBump"]); $t = time(); $wizard_transparent_button_final = $tpl->_ENGINE_parse_body("{wizard_transparent_button_final}"); $wizard_transparent_button_final = str_replace("%p1", $connected_port, $wizard_transparent_button_final); $wizard_transparent_button_final = str_replace("%p2", $transparent_port, $wizard_transparent_button_final); if ($EnableSSLBump == 1) { $enabled = $tpl->_ENGINE_parse_body("{enabled}"); } else { $enabled = $tpl->_ENGINE_parse_body("{disabled}"); } $wizard_transparent_button_final = str_replace("%enabled", $enabled, $wizard_transparent_button_final); $html = "<div style='width:98%' class=form>\n\t<div style='font-size:32px;margin-bottom:20px'>{ready_to_build}</div>\n\t<div class='text-info' style='font-size:18px;margin-bottom:20px'>{$wizard_transparent_button_final}</div>\n\t<table style='width:100%'>\n\t" . Field_button_table_autonome("{apply}", "Save{$t}", 26) . "</table>\n\t</div>\n<script>\n\n\nfunction Save{$t}(){\n\tYahooWin6Hide();\n\tLoadjs('squid.transparent.progress.php');\n}\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function authenticate_ip_ttl_form() { $t = time(); $sock = new sockets(); $page = CurrentPageName(); $tpl = new templates(); $authenticate_ip_ttl = intval($sock->GET_INFO("authenticate_ip_ttl")); if ($authenticate_ip_ttl == 0) { $authenticate_ip_ttl = 60; } $html = "<div class=explain style='font-size:14px'>{authenticate_ip_ttl}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t" . Field_text_table("authenticate_ip_ttl-{$t}", "{ttl} ({seconds})", $authenticate_ip_ttl, "16", null, 110) . Field_button_table_autonome("{apply}", "Save{$t}", 18) . "</table>\n\t</div>\n\t<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\n\t\t\n\t\t\n\t}\n\t\n\tfunction Save{$t}(){\n\t\tvar allow_duration=0;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('authenticate_ip_ttl', document.getElementById('authenticate_ip_ttl-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \t\t\n\t}\n</script>\t\t\t\n\t\t\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function rule_popup(){ $dans=new dansguardian_rules(); $md5=$_GET["rule-popup"]; $tpl=new templates(); $page=CurrentPageName(); $fields_size=22; $q=new mysql_squid_builder(); $sock=new sockets(); $t=time(); $bt="{add}"; if($md5<>null){$bt="{apply}";} $Timez[0]="{default}"; $Timez[5]="5 {minutes}"; $Timez[10]="10 {minutes}"; $Timez[15]="15 {minutes}"; $Timez[30]="30 {minutes}"; $Timez[60]="1 {hour}"; $Timez[120]="2 {hours}"; $Timez[240]="4 {hours}"; $Timez[720]="12 {hours}"; $Timez[2880]="2 {days}"; $cats=$dans->LoadBlackListes(); while (list ($num, $ligne) = each ($cats) ){$newcat[$num]=$num;} $newcat[null]="{none}"; $newcat["safebrowsing"]="Google Safe Browsing"; $newcat["blacklist"]="{blacklist}"; $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT * FROM ufdb_page_rules WHERE zmd5='$md5'")); if(!$q->ok){echo FATAL_ERROR_SHOW_128($q->mysql_error);return;} $html[]="<div style='width:98%' class=form>"; $html[]="<table style='width:100%'>"; $html[]=Field_list_table("category-$t","{category}",$ligne["category"],$fields_size,$newcat,null,450); $html[]=Field_list_table("maxtime-$t","{unlock_during}",$ligne["maxtime"],$fields_size,$Timez,null,450); $html[]=Field_text_table("adgroup-$t","{active_directory_group}",$ligne["adgroup"],$fields_size,null,450); $html[]=Field_text_table("username-$t","{username}",$ligne["username"],$fields_size,null,450); $html[]=Field_checkbox_table("deny-$t", "{deny_unlock}",$ligne["deny"],$fields_size,null,"UnCheckAllow$t()"); $html[]=Field_checkbox_table("allow-$t", "{allow_unlock}",$ligne["allow"],$fields_size,null,"UnCheckDeny$t()"); $html[]=Field_checkbox_table("noauth-$t", "{not_authenticate}",$ligne["noauth"],$fields_size); $html[]=Field_list_table("addTocat-$t","{automatically_add_to}",$ligne["addTocat"],$fields_size,$newcat,null,450); $html[]=Field_button_table_autonome($bt,"Submit$t",30); $html[]="</table>"; $html[]="</div> <script> var xSubmit$t= function (obj) { var results=obj.responseText; if(results.length>3){alert(results);} $('#UFDB_PAGE_RULE').flexReload(); } function UnCheckAllow$t(){ if(document.getElementById('deny-$t').checked){ document.getElementById('allow-$t').checked=false; }else{ document.getElementById('allow-$t').checked=true; } } function UnCheckDeny$t(){ if(document.getElementById('allow-$t').checked){ document.getElementById('deny-$t').checked=false; }else{ document.getElementById('deny-$t').checked=true; } } function Submit$t(){ var XHR = new XHRConnection(); XHR.appendData('rule','$md5'); XHR.appendData('category',document.getElementById('category-$t').value); XHR.appendData('adgroup',document.getElementById('adgroup-$t').value); XHR.appendData('username',document.getElementById('username-$t').value); XHR.appendData('addTocat',document.getElementById('addTocat-$t').value); XHR.appendData('maxtime',document.getElementById('maxtime-$t').value); if(document.getElementById('deny-$t').checked){ XHR.appendData('deny','1'); }else{ XHR.appendData('deny','0'); } if(document.getElementById('allow-$t').checked){ XHR.appendData('allow','1'); }else{ XHR.appendData('allow','0'); } if(document.getElementById('noauth-$t').checked){ XHR.appendData('noauth','1'); }else{ XHR.appendData('noauth','0'); } XHR.sendAndLoad('$page', 'POST',xSubmit$t); } UnCheckAllow$t(); </script> "; echo $tpl->_ENGINE_parse_body(@implode("\n", $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 rule_popup() { $dans = new dansguardian_rules(); $md5 = $_GET["rule-popup"]; $tpl = new templates(); $page = CurrentPageName(); $fields_size = 22; $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $bt = "{add}"; if ($md5 != null) { $bt = "{apply}"; } $Timez[0] = "{default}"; $Timez[5] = "5 {minutes}"; $Timez[10] = "10 {minutes}"; $Timez[15] = "15 {minutes}"; $Timez[30] = "30 {minutes}"; $Timez[60] = "1 {hour}"; $Timez[120] = "2 {hours}"; $Timez[240] = "4 {hours}"; $Timez[720] = "12 {hours}"; $Timez[2880] = "2 {days}"; $cats = $dans->LoadBlackListes(); while (list($num, $ligne) = each($cats)) { $newcat[$num] = $num; } $newcat[null] = "{all_categories}"; $newcat["safebrowsing"] = "Google Safe Browsing"; $newcat["blacklist"] = "{blacklist}"; $newcat["generic"] = "{generic}"; if (!$q->FIELD_EXISTS("ufdb_page_rules", "ticket")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `ticket` smallint(1) NOT NULL DEFAULT 0, ADD INDEX ( `ticket` )"); } if (!$q->FIELD_EXISTS("ufdb_page_rules", "ticket")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `ticket` smallint(1) NOT NULL DEFAULT 0, ADD INDEX ( `ticket` )"); } if (!$q->FIELD_EXISTS("ufdb_page_rules", "webruleid")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `webruleid` INT(10) NOT NULL NOT NULL DEFAULT 0, ADD INDEX ( `webruleid` )"); } $sql = "SELECT ID,groupname FROM webfilter_rules WHERE enabled=1"; $results = $q->QUERY_SQL($sql); $RULES["0"] = "{all_rules}"; $btname = "{add}"; $t = time(); while ($ligne = mysql_fetch_assoc($results)) { $RULES[$ligne["ID"]] = "{$ligne["groupname"]}"; } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM ufdb_page_rules WHERE zmd5='{$md5}'")); $group_legend = "{active_directory_group}"; if ($sock->SQUID_IS_EXTERNAL_LDAP()) { $group_legend = "{ldap_group}"; } if (!$q->ok) { echo FATAL_ERROR_SHOW_128($q->mysql_error); return; } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_list_table("webruleid-{$t}", "{rule}", $ligne["webruleid"], $fields_size, $RULES, null, 450); $html[] = Field_list_table("category-{$t}", "{category}", $ligne["category"], $fields_size, $newcat, null, 450); $html[] = Field_list_table("maxtime-{$t}", "{unlock_during}", $ligne["maxtime"], $fields_size, $Timez, null, 450); $html[] = Field_text_table("adgroup-{$t}", "{$group_legend}", $ligne["adgroup"], $fields_size, null, 450); if ($sock->SQUID_IS_EXTERNAL_LDAP()) { $html[] = Field_button_table_autonome("{browse}", "Loadjs('browse-extldap-groups.php?MainFunction=FdapGroup{$t}')"); } $html[] = Field_text_table("username-{$t}", "{username}", $ligne["username"], $fields_size, null, 450); $html[] = Field_checkbox_table("deny-{$t}", "{deny_unlock}", $ligne["deny"], $fields_size, null, "UnCheckAllow{$t}()"); $html[] = Field_checkbox_table("allow-{$t}", "{allow_unlock}", $ligne["allow"], $fields_size, null, "UnCheckDeny{$t}()"); $html[] = Field_checkbox_table("ticket-{$t}", "{submit_ticket}", $ligne["ticket"], $fields_size, null, "UnTicket{$t}()"); $html[] = Field_checkbox_table("noauth-{$t}", "{not_authenticate}", $ligne["noauth"], $fields_size); $html[] = Field_list_table("addTocat-{$t}", "{automatically_add_to}", $ligne["addTocat"], $fields_size, $newcat, null, 450); $html[] = Field_button_table_autonome($bt, "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n\t<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#UFDB_PAGE_RULE').flexReload();\n\t\n\t}\n\t\n\tfunction UnCheckAllow{$t}(){\n\t\tif(document.getElementById('deny-{$t}').checked){\n\t\t\tdocument.getElementById('allow-{$t}').checked=false;\n\t\t}else{\n\t\t\tdocument.getElementById('allow-{$t}').checked=true;\n\t\t\n\t\t}\n\t\n\t}\n\t\n\tfunction UnCheckDeny{$t}(){\n\t\tif(document.getElementById('allow-{$t}').checked){\n\t\t\tdocument.getElementById('deny-{$t}').checked=false;\n\t\t}else{\n\t\t\tdocument.getElementById('deny-{$t}').checked=true;\n\t\t}\n\t}\n\t\n\tfunction UnTicket{$t}(){\n\t\tif(document.getElementById('ticket-{$t}').checked){\n\t\t\tdocument.getElementById('deny-{$t}').checked=true;\n\t\t\tdocument.getElementById('allow-{$t}').checked=false;\n\t\t\tdocument.getElementById('noauth-{$t}').checked=true;\n\t\t\tdocument.getElementById('deny-{$t}').disabled=true;\n\t\t\tdocument.getElementById('allow-{$t}').disabled=true;\n\t\t\tdocument.getElementById('noauth-{$t}').disabled=true;\n\t\t\tdocument.getElementById('maxtime-{$t}').disabled=true;\n\t\t\tdocument.getElementById('addTocat-{$t}').disabled=true;\n\t\t}else{\n\t\t\tdocument.getElementById('deny-{$t}').disabled=false;\n\t\t\tdocument.getElementById('allow-{$t}').disabled=false;\n\t\t\tdocument.getElementById('noauth-{$t}').disabled=false;\n\t\t\tdocument.getElementById('maxtime-{$t}').disabled=false;\n\t\t\tdocument.getElementById('addTocat-{$t}').disabled=false;\n\t\t\t}\n\t\t\n\t}\n\t\n\tfunction FdapGroup{$t}(DN){\n\t\tdocument.getElementById('adgroup-{$t}').value='EXTLDAP:'+DN;\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('rule','{$md5}');\n\t\tXHR.appendData('category',document.getElementById('category-{$t}').value);\n\t\tXHR.appendData('adgroup',document.getElementById('adgroup-{$t}').value);\n\t\tXHR.appendData('username',document.getElementById('username-{$t}').value);\n\t\tXHR.appendData('addTocat',document.getElementById('addTocat-{$t}').value);\n\t\tXHR.appendData('maxtime',document.getElementById('maxtime-{$t}').value);\n\t\tXHR.appendData('webruleid',document.getElementById('webruleid-{$t}').value);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('deny-{$t}').checked){\n\t\t\tXHR.appendData('deny','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('deny','0');\t\n\t\t\n\t\t}\n\t\tif(document.getElementById('allow-{$t}').checked){\n\t\t\tXHR.appendData('allow','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('allow','0');\t\n\t\t\n\t\t}\t\n\n\t\tif(document.getElementById('noauth-{$t}').checked){\n\t\t\tXHR.appendData('noauth','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('noauth','0');\t\n\t\t\n\t\t}\n\n\t\tif(document.getElementById('ticket-{$t}').checked){\n\t\t\tXHR.appendData('ticket','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('ticket','0');\t\n\t\t\n\t\t}\t\t\t\n\t\t\n\t\t\n\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n\tUnCheckAllow{$t}();\n\tUnTicket{$t}();\n\t</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function GoogleSafeBrowsingApiKey_popup() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $GoogleSafeBrowsingApiKey = $sock->GET_INFO("GoogleSafeBrowsingApiKey"); $GoogleSafeBrowsingCacheTime = intval($sock->GET_INFO("GoogleSafeBrowsingCacheTime")); if ($GoogleSafeBrowsingCacheTime == 0) { $GoogleSafeBrowsingCacheTime = 10080; } $GoogleSafeBrowsingDNS = $sock->GET_INFO("GoogleSafeBrowsingDNS"); $GoogleSafeBrowsingInterface = $sock->GET_INFO("GoogleSafeBrowsingInterface"); if ($GoogleSafeBrowsingDNS == null) { $GoogleSafeBrowsingDNS = "8.8.8.8,4.4.4.4"; } $ip = new networking(); while (list($eth, $cip) = each($ip->array_TCP)) { if ($cip == null) { continue; } $arrcp[$cip] = $cip; } $arrcp[null] = "{default}"; $TTCACHE[1440] = "1 {day}"; $TTCACHE[2880] = "2 {days}"; $TTCACHE[10080] = "7 {days}"; $TTCACHE[20160] = "1 {week}"; $TTCACHE[43200] = "1 {month}"; $t = time(); $WgetBindIpAddress = Field_array_Hash($arrcp, "GoogleSafeBrowsingInterface-{$t}", $GoogleSafeBrowsingInterface, null, null, 0, "font-size:18px;padding:3px;"); $html = "<div style='width:98%' class=form>\n<table style='width:100%'>\n<tr>\n\t<td class=legend style='font-size:18px'>{GoogleSafeBrowsingApiKey_ask}:</td>\t\t\n\t<td>" . Field_text("GoogleSafeBrowsingApiKey-{$t}", $GoogleSafeBrowsingApiKey, "font-size:18px;width:450px") . "</td>\n</tR>\n<tr>\n\t<td class=legend style='font-size:18px'>{nameserver}:</td>\t\t\n\t<td>" . Field_text("GoogleSafeBrowsingDNS-{$t}", $GoogleSafeBrowsingDNS, "font-size:18px;width:250px") . "</td>\n</tR>\t\n<tr>\n\t<td class=legend style='font-size:18px'>{WgetBindIpAddress}:</td>\t\t\n\t<td>{$WgetBindIpAddress}</td>\n</tR>\t\t\t\t\t\n<tr>\n\t<td class=legend style='font-size:18px'>{local_cache_time}:</td>\t\t\n\t<td>" . Field_array_Hash($TTCACHE, "GoogleSafeBrowsingCacheTime-{$t}", $GoogleSafeBrowsingCacheTime, null, null, 0, "font-size:18px") . "</td>\n</tR>\t\n" . Field_button_table_autonome("{apply}", "Save{$t}()", 32) . "</table>\t\t\n\t</div>\t\n<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tLoadjs('dansguardian2.compile.php');\n\t\tRefreshTab('main_dansguardian_mainrules');\n\t}\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('GoogleSafeBrowsingApiKey', document.getElementById('GoogleSafeBrowsingApiKey-{$t}').value);\n\t\tXHR.appendData('GoogleSafeBrowsingCacheTime', document.getElementById('GoogleSafeBrowsingCacheTime-{$t}').value);\n\t\tXHR.appendData('GoogleSafeBrowsingDNS', document.getElementById('GoogleSafeBrowsingDNS-{$t}').value);\n\t\tXHR.appendData('GoogleSafeBrowsingInterface', document.getElementById('GoogleSafeBrowsingInterface-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t}\n</script>\t\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function csr_gen() { $tpl = new templates(); $users = new usersMenus(); $page = CurrentPageName(); $sock = new sockets(); $ligne = unserialize($sock->GET_INFO("CertificateCenterCSR")); $t = time(); if ($ligne["CountryName"] == null) { $ligne["CountryName"] = "US"; } if ($ligne["stateOrProvinceName"] == null) { $ligne["stateOrProvinceName"] = "New York"; } if ($ligne["localityName"] == null) { $ligne["localityName"] = "Brooklyn"; } if ($ligne["emailAddress"] == null) { $ligne["emailAddress"] = "*****@*****.**"; } if ($ligne["OrganizationName"] == null) { $ligne["OrganizationName"] = "MyCompany Ltd"; } if ($ligne["OrganizationalUnit"] == null) { $ligne["OrganizationalUnit"] = "IT service"; } if (!is_numeric($ligne["CertificateMaxDays"])) { $ligne["CertificateMaxDays"] = 730; } if (!is_numeric($ligne["levelenc"])) { $ligne["levelenc"] = 1024; } $button_save = $tpl->_ENGINE_parse_body(button("{edit}", "Save{$t}()", 30)); if ($ligne["password"] == null) { $ligne["password"] = "******"; } $sock->getFrameWork("openssl.php?copy-csr=yes"); $data = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/Myprivkey.csr"); @unlink("/usr/share/artica-postfix/ressources/logs/web/Myprivkey.csr"); $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("CommonName-{$t}", "{CommonName}", $ligne["CommonName"], 22, null, 400); $html[] = Field_text_table("CountryName-{$t}", "{countryName}", $ligne["CountryName"], 22, null, 110); $html[] = Field_text_table("stateOrProvinceName-{$t}", "{stateOrProvinceName}", $ligne["stateOrProvinceName"], 22, null, 400); $html[] = Field_text_table("localityName-{$t}", "{localityName}", $ligne["localityName"], 22, null, 400); $html[] = Field_text_table("OrganizationName-{$t}", "{organizationName}", $ligne["OrganizationName"], 22, null, 400); $html[] = Field_text_table("OrganizationalUnit-{$t}", "{organizationalUnitName}", $ligne["OrganizationalUnit"], 22, null, 400); $html[] = Field_text_table("emailAddress-{$t}", "{emailAddress}", $ligne["emailAddress"], 22, null, 400); $html[] = Field_password_table("password-{$t}", "{password}", $ligne["password"], 22, null, 300); $html[] = Field_button_table_autonome("{generate_csr}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "<hr>\n\t<textarea\n\tstyle='margin-top:5px;font-family:Courier New;\n\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;\n\toverflow:auto;font-size:16px !important;width:99%;height:390px' id='csr-{$t}'>{$data}</textarea>\n\t"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tRefreshTab('main_certificates_center_tabs');\n\tif(document.getElementById('squid_ports_popup_certificates')){\n\t\tvar id=document.getElementById('squid_ports_popup_certificates_num').value;\n\t\tvar Common=document.getElementById('CommonName-{$t}').value;\n\t\tLoadAjaxSilent('squid_ports_popup_certificates','squid.ports.php?certificate-refresh=yes&default='+Common+'&t='+id);\n\t}\n\t\n\t\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('GEN-CSR','yes');\n\tXHR.appendData('CommonName',encodeURIComponent(document.getElementById('CommonName-{$t}').value));\n\tXHR.appendData('CountryName',encodeURIComponent(document.getElementById('CountryName-{$t}').value));\n\tXHR.appendData('stateOrProvinceName',encodeURIComponent(document.getElementById('stateOrProvinceName-{$t}').value));\n\tXHR.appendData('localityName',encodeURIComponent(document.getElementById('localityName-{$t}').value));\n\tXHR.appendData('OrganizationName',encodeURIComponent(document.getElementById('OrganizationName-{$t}').value));\n\tXHR.appendData('OrganizationalUnit',encodeURIComponent(document.getElementById('OrganizationalUnit-{$t}').value));\n\tXHR.appendData('emailAddress',encodeURIComponent(document.getElementById('emailAddress-{$t}').value));\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n</script>\n"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function rule_files_types() { $MimeArray = MimeArray(); $ID = $_GET["ID"]; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $t = time(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT `FileTypes` FROM artica_caches WHERE ID='{$ID}'", "artica_backup")); $FileTypes = unserialize($ligne["FileTypes"]); while (list($mime, $ligne) = each($MimeArray)) { $FT = explode("/", $mime); $FT[0] = trim($FT[0]); if ($FT[0] == null) { continue; } $MIMETT[$FT[0]] = true; $FTMIME[$FT[0]][] = $mime; } krsort($MIMETT); while (list($mimeF, $ligne) = each($MIMETT)) { if (trim($mimeF) == null) { continue; } if (count($FTMIME[$mimeF]) == 0) { continue; } $mainid = md5($mimeF . $t); ksort($FTMIME[$mimeF]); $htmlez = array(); $c = 0; while (list($mimeF2, $mime) = each($FTMIME[$mimeF])) { $mimeEnc = md5("{$mime}-{$t}"); if (!isset($FileTypes[$mime])) { $FileTypes[$mime] = 0; } $htmlez[] = "\t" . Field_checkbox_table($mimeEnc, $mime, $FileTypes[$mime]) . "\n"; $scripts[] = "if(document.getElementById('{$mimeEnc}').checked){XHR.appendData('{$mime}',1);}else{XHR.appendData('{$mime}',0);}"; $c++; } if (count($htmlez) == 0) { continue; } $INVIS[] = "document.getElementById('{$mainid}').style.display='none';"; $htmle[] = "\n\t\t<div>\n\t\t\t<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:Switch{$t}('{$mainid}');\" \n\t\t\tstyle='font-size:30px;text-decoration:underline'>{$mimeF}</a>\n\t\t</div>\n\t\t<div id='{$mainid}' style='display:none'>\n\t\t\t<table style='width:100%'>" . @implode("\n", $htmlez) . "</table>\n\t\t</div>"; } $html = "\n<div style='width:98%' class=form>\n\t" . @implode("\n", $htmle) . "<table style='width:100%'>" . Field_button_table_autonome("{apply}", "Save{$t}()", 26) . "\n\t\t</table>\n</div>\n<script>\nvar xSave{$t}=function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\t\$('#squid_enforce_rules_table').flexReload();\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('MIME-ID','{$_GET["ID"]}');\n\t" . @implode("\n", $scripts) . "\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t}\n\n\nfunction Switch{$t}(mainid){\n\t" . @implode("\n", $INVIS) . "\n\tdocument.getElementById(mainid).style.display='block';\n}\n\t\n\n</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function wizard_certificate_1() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $hostname = $sock->GET_INFO("myhostname"); $t = time(); $ENC[1024] = 1024; $ENC[2048] = 2048; $ENC[4096] = 4096; if ($hostname == null) { $hostname = $sock->getFrameWork("system.php?hostname-g=yes"); $sock->SET_INFO($hostname, "myhostname"); } $title = $tpl->_ENGINE_parse_body("{new_certificate}"); $html[] = "<div class=explain style='font-size:18px'>{wizard_certificate_1}<br><i>{CSR_MULTIPLE_EXPLAIN}</i></div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("wizard-certificate-commonname", "{CommonName}", $hostname, 22, null, 400); $html[] = Field_checkbox_table("AsSquidCertificate", "{proxy_certificate}", 0, 22, "{proxy_gen_certificate_explain}"); $html[] = Field_list_table("wizard-certificate-levelenc", "{level_encryption}", 2048, 22, $ENC); $html[] = Field_password_table("wizard-certificate-password", "{password}", "secret", 22, null, 300); $html[] = Field_button_table_autonome("{add}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\n\tif(document.getElementById('squid_ports_popup_certificates')){\n\t\tif(document.getElementById('squid_ports_popup_certificates_num')){\n\t\t\tvar id=document.getElementById('squid_ports_popup_certificates_num').value;\n\t\t\tvar Common=document.getElementById('wizard-certificate-commonname').value;\n\t\t\tLoadAjaxSilent('squid_ports_popup_certificates','squid.ports.php?certificate-refresh=yes&default='+Common+'&t='+id);\n\t\t}\n\t}\t\n\t\n\t\n\t\$('#TABLE_CERTIFICATE_CENTER_MAIN').flexReload();\n\t\n\tvar commonName=document.getElementById('wizard-certificate-commonname').value;\n\tLoadjs('openssl.CSR.progress.php?generate-csr='+commonName);\n\tYahooWin6Hide();\n\t\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('wizard-certificate-commonname',encodeURIComponent(document.getElementById('wizard-certificate-commonname').value));\n\tXHR.appendData('wizard-certificate-levelenc',document.getElementById('wizard-certificate-levelenc').value);\n\tXHR.appendData('wizard-certificate-password',encodeURIComponent(document.getElementById('wizard-certificate-password').value));\n\tif(document.getElementById('AsSquidCertificate').checked){\n\t\tXHR.appendData('wizard-certificate-proxy',1);\n\t}else{\n\t\tXHR.appendData('wizard-certificate-proxy',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function manager_password_popup() { $page = CurrentPageName(); $tpl = new templates(); $artica_meta = new mysql_meta(); $t = time(); $global_admin_confirm = $tpl->javascript_parse_text("{global_admin_confirm}"); if ($_GET["gpid"] == 0) { $hostname = $artica_meta->uuid_to_host($_GET["uuid"]); } else { $hostname = $tpl->javascript_parse_text("{computers}: ") . $artica_meta->gpid_to_name($_GET["gpid"]); } $html = "\n<div id='ChangePasswordDivNOtifiy' style='width:98%' class=form>\n<table style='width:100%'>\n\t<tr>\n\t\t<td colspan=2 style='border-bottom:1px solid #CCCCCC;padding-top:4px;margin-bottom:20px'>\n\t\t\t<strong style='font-size:32px;'>{global_admin_account}: {$hostname}</strong>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 > </td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' class=legend nowrap style='font-size:22px'>{username}:</strong></td>\n\t\t<td align='left'>" . Field_text("change_admin-{$t}", null, 'width:99%;font-size:22px;padding:3px', "script:ChangeGlobalAdminPasswordCheck{$t}(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' class=legend nowrap class=legend style='font-size:22px'>{password}:</strong></td>\n\t\t<td align='left'>" . Field_password("change_password-{$t}", null, "width:90%;font-size:22px;padding:3px", "script:ChangeGlobalAdminPasswordCheck{$t}(event)") . "</td>\n\t</tr>\n\t" . Field_button_table_autonome("{apply}", "ChangeGlobalAdminPassword{$t}", 26) . "\n</table>\n</div>\n<script>\n\t\nfunction ChangeGlobalAdminPasswordCheck{$t}(e){\n\tif(checkEnter(e)){ChangeGlobalAdminPassword{$t}();}\n}\n\nvar xChangeGlobalAdminPassword{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\t\$('#ARTICA_META_MAIN_TABLE').flexReload();\n\tYahooWin4Hide();\n}\n\nfunction ChangeGlobalAdminPassword{$t}(){\n\t\n\tif(!confirm('{$global_admin_confirm}')){return;}\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('change_admin',document.getElementById('change_admin-{$t}').value);\n\tXHR.appendData('uuid','{$_GET["uuid"]}');\n\tXHR.appendData('gpid','{$_GET["gpid"]}');\n\tvar password=encodeURIComponent(document.getElementById('change_password-{$t}').value);\n\tXHR.appendData('change_password',password);\n\tXHR.appendData('manager-password','yes');\n\tXHR.sendAndLoad('{$page}', 'POST',xChangeGlobalAdminPassword{$t});\n}\n</script>\n"; 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 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")); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); $EnableIntelCeleron = intval(file_get_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron")); if ($SquidPerformance == 0) { if ($EnableLocalUfdbCatService == 0) { $p00 = Paragraphe_switch_img("{local_categories_services_activated}", "{use_local_categories_services_perf}</strong>", "none", 1, null, 800, "blur()") . "<hr><p> </p>"; } } 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()"); if ($SquidPerformance > 2) { $EnableLocalUfdbCatService = 0; $p0 = Paragraphe_switch_disable("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{use_local_categories_services_explain_warn}</strong>", "EnableLocalUfdbCatService", $EnableLocalUfdbCatService, null, 800, "EnableLocalUfdbCatServiceCheck()"); } if ($EnableIntelCeleron == 1) { $EnableLocalUfdbCatService = 0; $p0 = Paragraphe_switch_disable("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{CELERON_METHOD_EXPLAIN}</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 = "\n<div style='width:98%' class=form>\n\t\t\t{$p00}{$p0}\n\t\t\t<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>\n\t\t\t<div id='design1-{$t}'>{$p1}\n\t<table style='width:100%'>\n\t " . Field_text_table("ufdbCatInterface", "{remote_address}", $ufdbCatInterface, 22, null, 230) . Field_text_table("ufdbCatPort", "{listen_port}", $ufdbCatPort, 22, null, 120) . "</table>\n\t</div>" . "\n\t\t\t\n\t\t\t\n<table style='width:100%'>" . Field_button_table_autonome("{apply}", "Save{$t}()", 32) . "\n\t\t</table>\n\t\t</div>\n\t\t<script>\nvar xSave{$t}=function (obj) {\n\tRefreshTab('main_ufdbguard_config');\n\tLoadjs('squid.reconfigure.simple.php');\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value;\n\t\n\tif(EnableLocalUfdbCatService==0){\n\t\tXHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface').value);\n\t\tXHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort').value);\n\t\tXHR.appendData('RemoteUfdbCat',document.getElementById('RemoteUfdbCat').value);\n\t}else{\n\t\tXHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface1').value);\n\t\tXHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort1').value);\n\t\tXHR.appendData('UfdbCatThreads',document.getElementById('UfdbCatThreads1').value);\n\t\n\t}\n\tXHR.appendData('EnableLocalUfdbCatService',document.getElementById('EnableLocalUfdbCatService').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\t\n\t\n\tfunction EnableLocalUfdbCatServiceCheck(){\n\tvar EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value;\n\t\t\tdocument.getElementById('ufdbCatInterface').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatPort').disabled=false;\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatInterface1').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatPort1').disabled=true;\n\t\t\tdocument.getElementById('UfdbCatThreads1').disabled=true;\n\t\t\t\n\t\t\tdocument.getElementById('design1-{$t}').style.visibility='visible';\n\t\t\t\n\t\t\n\t\tif(EnableLocalUfdbCatService==1){\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatInterface').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatPort').disabled=true;\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatInterface1').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatPort1').disabled=false;\n\t\t\tdocument.getElementById('UfdbCatThreads1').disabled=false;\n\t\t\t\n\t\t\tdocument.getElementById('design1-{$t}').style.visibility='hidden';\n\t\t}\n\t\t\n\t\tCheckBoxDesignHidden();\n\t}\n\tEnableLocalUfdbCatServiceCheck();\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }