function ntpdAddCountry() { $ntp = new ntpd(); $countries = $ntp->ServersList(); unset($ntp->servers); while (list($num, $server) = each($countries[$_GET["country"]])) { $ntp->servers[] = $server; } $ntp->SaveToLdap(); }
function ntpdAddCountry() { $sock = new sockets(); $GLOBALS["TIMEZONES"] = $_POST["timezones"]; $_SESSION["TIMEZONES"] = $_POST["timezones"]; $sock->SET_INFO("timezones", $_POST["timezones"]); $sock->getFrameWork("system.php?zoneinfo-set=" . base64_encode($_POST["timezones"])); $ntp = new ntpd(); $countries = $ntp->ServersList(); $q = new mysql(); $array = $countries[$_POST["country"]]; writelogs("{$_POST["country"]}! TRUNCATE TABLE ntpd_servers", __FUNCTION__, __FILE__, __LINE__); $q->QUERY_SQL("TRUNCATE TABLE ntpd_servers", "artica_backup"); while (list($num, $server) = each($array)) { $added[] = $server; $sql = "INSERT IGNORE INTO ntpd_servers (`ntp_servers`,`ntpd_servers`.`order`) VALUES ('{$server}','{$num}')"; writelogs("{$_POST["country"]}! {$sql}", __FUNCTION__, __FILE__, __LINE__); $q->QUERY_SQL($sql, "artica_backup"); if (!$q->ok) { $q->mysql_error; } } $ntp->SaveToLdap(); $tpl = new templates(); echo $tpl->javascript_parse_text("{added}\n" . @implode("\n", $array), 1); }