Example #1
0
function ChangeSettings($ID)
{
    $sql = "SELECT * FROM mldonkey WHERE ID='{$ID}'";
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $array = unserialize(base64_decode($ligne["parameters"]));
    $ml = new EmuleTelnet();
    if ($array["max_hard_upload_rate"] == null) {
        $array["max_hard_upload_rate"] = 0;
    }
    if ($array["max_hard_download_rate"] == null) {
        $array["max_hard_download_rate"] = 0;
    }
    $max_hard_upload_rate = $ml->parameters_save("max_hard_upload_rate", $array["max_hard_upload_rate"]);
    $max_hard_download_rate = $ml->parameters_save("max_hard_download_rate", $array["max_hard_download_rate"]);
    $files_queries_per_minute = $ml->parameters_save("files_queries_per_minute", 1);
    $server_connection_timeout = $ml->parameters_save("server_connection_timeout", 25);
    $propagate_sources = $ml->parameters_save("propagate_sources", "true");
    $ml->SaveConfig();
    $text = "\n\tParameters was modified to:\n\t---------------------------------\n\tUpload rate: {$array["max_hard_upload_rate"]}kb/s ({$max_hard_upload_rate})\n\tDownload rate: {$array["max_hard_download_rate"]}kb/s ({$max_hard_download_rate})\n\tfiles_queries_per_minute:1 mn ({$files_queries_per_minute})\n\tserver_connection_timeout:25s ({$server_connection_timeout})\n\tpropagate_sources:True ({$propagate_sources})\n\t";
    writelogs("MLDonkey Upload:{$array["max_hard_upload_rate"]}kb/s Down:{$array["max_hard_download_rate"]}kb/s", __FUNCTION__, __FILE__, __LINE__);
    send_email_events("[Task {$ID}]: MLDonkey Upload:{$array["max_hard_upload_rate"]}kb/s Down:{$array["max_hard_download_rate"]}kb/s", $text, "system");
}
Example #2
0
function SaveParams()
{
    $ml = new EmuleTelnet();
    while (list($num, $val) = each($_GET)) {
        $ml->parameters_save($num, $val);
    }
    $ml->SaveConfig();
}