exit; } if (isset($_GET["popup"])) { popup(); exit; } if (isset($_GET["enable-ntpd-switch"])) { ntpd_switch(); exit; } if (isset($_GET["list"])) { echo main_server_list(); exit; } if (isset($_GET["country"])) { ntpdAddCountry(); exit; } js(); function js() { $page = CurrentPageName(); $prefix = "ntpdpage"; $tpl = new templates(); $title = $tpl->_ENGINE_parse_body('{APP_NTPD}'); $give_server_name = $tpl->_ENGINE_parse_body('{give_server_name}'); $html = "\n\n\t\tfunction {$prefix}load(){\n\t\t\tYahooSetupControl(650,'{$page}?popup=yes','{$title}');\n\t\t\t{$prefix}timeout=0;\n\t\t\t\n\t\t}\n\n\t\t\n\t\tfunction {$prefix}FILL(){\n\t\t\t{$prefix}timeout={$prefix}timeout+1;\n\t\t\tif({$prefix}timeout>10){alert('timeout');return;}\n\t\t\tif(!document.getElementById('ntpd_main_config')){\n\t\t\t\tsetTimeout(\"{$prefix}FILL()\",900);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tLoadAjax('ntpd_main_config','{$page}?main=yes');\n\t\t\tif(YahooWinSOpen()){YahooWinSHide();}\n\t\t\t\n\t\t\tChargeLogs();\n\t\t\t{$prefix}demarre();\n\t}\n\t\n\t\nvar refresh_server_list= function (obj) {\n\t\t\tLoadAjax('serverlist','{$page}?list=yes');\n\t\t\t}\t\t\n\t\t\n\t\tfunction ntpdAdd(){\n\t\t var server=prompt('{$give_server_name}');\n\t\t if(server){\n\t var XHR = new XHRConnection();\n\t\t XHR.appendData('ntpdAdd',server);\n\t\t XHR.sendAndLoad('ntpd.index.php', 'GET',refresh_server_list); \n\t\t }\n\t\t}\n\n\t\tfunction ntpdservermove(num,dir){\n\t\t var XHR = new XHRConnection();\n\t\t XHR.appendData('ntpdservermove',num);\n\t\t XHR.appendData('direction',dir);\n\t\t XHR.sendAndLoad('ntpd.index.php', 'GET',refresh_server_list); \n\t\t }\n\t\t \n\t\tfunction ntpdserverdelete(num){\n\t\t var XHR = new XHRConnection();\n\t\t XHR.appendData('ntpdserverdelete',num);\n\t\t XHR.sendAndLoad('ntpd.index.php', 'GET',refresh_server_list); \n\t\t }\n\t\t\n\t\tfunction ntpdSave(){\n\t\t YahooWin(440,'ntpd.index.php?op=-1');\n\t\t for(var i=0;i<5;i++){\n\t\t setTimeout('ntpdSave_run('+i+')',1500);\n\t\t }\n\t\t}\n\t\tfunction ntpdSave_run(number){\n\t\t LoadAjax2('message_'+number,'ntpd.index.php?op='+number)\n\t\t }\n\n{$prefix}load();\n"; echo $html; } function popup() {
include_once('ressources/class.mysql.inc'); include_once('ressources/class.ini.inc'); include_once('ressources/class.ntpd.inc'); $user=new usersMenus(); if($user->AsArticaAdministrator==false){header('location:users.index.php');exit();} if(isset($_GET["main"])){main_switch();exit;} if(isset($_GET["status"])){echo main_status();exit;} if(isset($_GET["ntpdAdd"])){ntpdAdd();exit;} if(isset($_GET["ntpdservermove"])){ntpdservermove();exit;} if(isset($_GET["ntpdserverdelete"])){ntpdserverdelete();exit;} if(isset($_GET["NTPDEnabled"])){NTPDEnabled();exit;} if(isset($_GET["op"])){main_switch_op();exit;} if(isset($_GET["popup"])){popup();exit;} if(isset($_GET["enable-ntpd-switch"])){ntpd_switch();exit;} if(isset($_GET["list"])){echo main_server_list();exit;} if(isset($_GET["country"])){ntpdAddCountry();exit;} js(); function js(){ $page=CurrentPageName(); $prefix="ntpdpage"; $tpl=new templates(); $title=$tpl->_ENGINE_parse_body('{APP_NTPD}'); $give_server_name=$tpl->_ENGINE_parse_body('{give_server_name}'); $html= " function {$prefix}load(){ YahooSetupControl(650,'$page?popup=yes','$title');