function main_page() { switch ($_GET["main"]) { case "network": main_network(); exit; break; case "Safe_ports": main_Safe_ports(); exit; break; case "config": main_configfile(); exit; break; case "Safe_ports_list": echo main_Safe_ports_list(); exit; break; case "deny_ext": main_denyext(); exit; break; case "deny_ext_list": echo main_denyext_list(); exit; break; case "kavav": echo main_kav4proxy(); exit; break; case "info": echo main_infos(); exit; break; default: break; } if ($_GET["hostname"] == null) { $user = new usersMenus(); $hostname = $user->hostname; $_GET["hostname"] = $hostname; } else { $hostname = $_GET["hostname"]; } $apply = applysettings("squid", "SQUID_APPLY('{$_GET["hostname"]}')"); $html = "\n<script language=\"JavaScript\"> \nvar timerID = null;\nvar timerID1 = null;\nvar tant=0;\nvar reste=0;\n\nfunction demarre(){\n tant = tant+1;\n reste=10-tant;\n\tif (tant < 10 ) { \n timerID = setTimeout(\"demarre()\",5000);\n } else {\n tant = 0;\n //document.getElementById('wait').innerHTML='<img src=img/wait.gif>';\n ChargeLogs();\n demarre(); //la boucle demarre !\n }\n}\n\n\nfunction ChargeLogs(){\n\tvar status='status';\n\t\n\tif(document.getElementById('statusid')){\n\t\tstatus=document.getElementById('statusid').value;\n\t}\n\tLoadAjax('services_status','squid.index.php?status='+ status+'&hostname={$_GET["hostname"]}');\n\t}\n</script>\t\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/bg_squid.jpg'><p class=caption>{squid_simple_intro}</p></td>\n\t<td valign='top'>\n\t<div id='services_status'></div>\n\t</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 valign='top'>\n\t\t\t<div id='squid_main_config'></div>\n\t\t</td>\n\t</tr>\n\t</table>\n\t<script>LoadAjax('squid_main_config','{$page}?main=network');</script>\n\t<script>demarre();</script>\n\t<script>ChargeLogs();</script>\n\t"; $cfg["JS"][] = 'js/squid.js'; $cfg["JS"][] = 'js/icap.js'; $tpl = new template_users('Squid', $html, 0, 0, 0, 0, $cfg); echo $tpl->web_page; }
function main_switch(){ if(!isset($_GET["tab"])){$_GET["tab"]="status";}; $squid=new squid(); if($_GET["hostname"]==null){ $users=new usersMenus(); $_GET["hostname"]=$users->hostname; } switch ($_GET["tab"]) { case "status":main_status();break; case "config":main_configfile();break; case "networking":main_networking();break; case "access":main_access_rules();break; case "icap_service":main_icap_service();break; case "cache":main_cache();break; case "acl":main_acls();break; default: break; } }