header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");	
	$user=new usersMenus();
	if(!$user->AsSquidAdministrator){
		$tpl=new templates();
		echo "alert('".$tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		exit;
		
	}
	
	
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["SelectDansGuardianExceptionipList"])){echo FindComputerByIP();exit;}
	if(isset($_GET["AddDansGuardianExceptionipList"])){AddDansGuardianExceptionipList();exit;}
	if(isset($_GET["ExceptionipListRefresh"])){echo ComputersList();exit;}
	if(isset($_GET["DelDansGuardianExceptionipList"])){DelDansGuardianExceptionipList();exit;}
	js();
	
	
function js(){
	
$page=CurrentPageName();
$tpl=new templates();

$prefix=str_replace(".","_",$page);
$title=$tpl->_ENGINE_parse_body("{black_ip_group}");
$html="
var {$prefix}timerID  = null;
var {$prefix}timerID1  = null;
var {$prefix}tant=0;
var {$prefix}reste=0;
Beispiel #2
0
    exit;
}
if (isset($_GET["SelectDansGuardianExceptionipList"])) {
    echo FindComputerByIP();
    exit;
}
if (isset($_GET["AddDansGuardianExceptionipList"])) {
    AddDansGuardianExceptionipList();
    exit;
}
if (isset($_GET["ExceptionipListRefresh"])) {
    echo ComputersList();
    exit;
}
if (isset($_GET["DelDansGuardianExceptionipList"])) {
    DelDansGuardianExceptionipList();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $prefix = str_replace(".", "_", $page);
    $title = $tpl->_ENGINE_parse_body("{white_ip_group}");
    $html = "\nvar {$prefix}timerID  = null;\nvar {$prefix}timerID1  = null;\nvar {$prefix}tant=0;\nvar {$prefix}reste=0;\nvar m_gpid;\nvar m_ou;\n\nfunction {$prefix}load(){\n\tYahooWin2('750','{$page}?popup=yes','{$title}');\n}\n\nfunction {$prefix}StartPage(){\n\tif(!document.getElementById('squid_main_config')){\n\t\tsetTimeout(\"{$prefix}StartPage()\",500);\n\t}\n\tLoadAjax('squid_main_config','{$page}?main=yes');\n\tsetTimeout(\"{$prefix}demarre()\",500);\n\tsetTimeout(\"{$prefix}ChargeLogs()\",500)\n}\n\n\tfunction {$prefix}demarre(){\n\t\t{$prefix}tant = {$prefix}tant+1;\n\t\t{$prefix}reste=10-{$prefix}tant;\n\t\t\tif ({$prefix}tant < 10 ) {                           \n\t\t{$prefix}timerID = setTimeout(\"demarre()\",5000);\n\t\t      } else {\n\t\t{$prefix}tant = 0;\n\t\t              \n\t\t{$prefix}ChargeLogs();\n\t\t{$prefix}demarre();                                //la boucle demarre !\n\t\t   }\n\t}\n\n\nfunction {$prefix}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','squid.index.php?status='+status+'&hostname={$_GET["hostname"]}&apply-settings=no');\n\t}\n\t\n\t\t\n\tfunction AddCache(folder){\n\t\tdocument.getElementById('cache_graph').innerHTML='';\n\t\tYahooWin(500,'{$page}?add-cache=yes&cache='+folder);\n\t\t\n\t}\n\t\nvar x_DeleteCache= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue)};\n    cachelist();  \n\t}\t\n\t\nfunction cachelist(){\n\tLoadAjax('cache_list','{$page}?cache-list=yes');   \n}\n\t\nfunction DeleteCache(folder){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DeleteCache',folder);\n\t\tdocument.getElementById('cache_list').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_DeleteCache);\n}\n\nfunction ConnectionTime(){\n\tYahooWin(500,'{$page}?connection-time=yes');\n}\n\nfunction ConnectionTimeSelectOU(){\n\tvar ou=document.getElementById('ou').value;\n\tLoadAjax('group_field','{$page}?connection-time-showgroup='+ou);\n\t}\n\t\nfunction ConnectionTimeSelectGroup(){\n\tvar ou=document.getElementById('ou').value;\n\tvar gpid=document.getElementById('gpid').value;\n\tLoadAjax('ConnectionTimeRule','{$page}?connection-time-rule=yes&ou='+ou+'&gpid='+gpid);\n\t\n}\n\nfunction ConnecTimeRefreshlist(gpid,ou){\nLoadAjax('rule_list','{$page}?time-rule-list=yes&gpid='+gpid+'&ou='+ou);   \n}\n\nvar x_SelectDansGuardianExceptionipList= function (obj) {\n\tdocument.getElementById('popup_selected_computers').innerHTML=obj.responseText;\n\t}\n\t\nvar x_ExceptionipList_Refresh_list= function (obj) {\n\tdocument.getElementById('popup_saved_computers').innerHTML=obj.responseText;\n\t}\t\n\t\nfunction ExceptionipList_Refresh_list(){\n\tvar XHR = new XHRConnection();\n\tdocument.getElementById('popup_saved_computers').innerHTML='<center><img src=\"img/wait.gif\"></center>'\n\tXHR.appendData('ExceptionipListRefresh','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_ExceptionipList_Refresh_list);\n}\n\t\nvar x_AddDansGuardianExceptionipList= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tExceptionipList_Refresh_list();\n\t}\n\n\tfunction SelectDansGuardianExceptionipListButton(){\t\n\t\tAddDansGuardianExceptionipList(document.getElementById('IpWhite').value);\n\t}\n\n\nfunction SelectDansGuardianExceptionipList(e){\n\n\tif(checkEnter(e)){\n\t\tAddDansGuardianExceptionipList(document.getElementById('IpWhite').value);\n\t\treturn;\n\t}\n\n\tvar XHR = new XHRConnection();\n\tdocument.getElementById('popup_selected_computers').innerHTML='<center><img src=\"img/wait.gif\"></center>'\n\tXHR.appendData('SelectDansGuardianExceptionipList',document.getElementById('IpWhite').value);\n\tXHR.sendAndLoad('{$page}', 'GET',x_SelectDansGuardianExceptionipList);\n}\n\nfunction AddDansGuardianExceptionipList(ip,uid){\nvar XHR = new XHRConnection();\n\tdocument.getElementById('popup_saved_computers').innerHTML='<center><img src=\"img/wait.gif\"></center>'\n\tXHR.appendData('AddDansGuardianExceptionipList',ip);\n\tXHR.appendData('uid',uid);\n\tXHR.sendAndLoad('{$page}', 'GET',x_AddDansGuardianExceptionipList);\n\n}\n\nfunction DelDansGuardianExceptionipList(ip){\nvar XHR = new XHRConnection();\n\tdocument.getElementById('popup_saved_computers').innerHTML='<center><img src=\"img/wait.gif\"></center>'\n\tXHR.appendData('DelDansGuardianExceptionipList',ip);\n\tXHR.sendAndLoad('{$page}', 'GET',x_AddDansGuardianExceptionipList);\n}\n\n\n\n{$prefix}load();";
    echo $html;
}
function popup()
{
    $tpl = new templates();