Esempio n. 1
0
function ntpdserverdelete()
{
    $ntp = new ntpd();
    unset($ntp->servers[$_GET["ntpdserverdelete"]]);
    $ntp->SaveToLdap();
}
Esempio n. 2
0
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);
}