function page() { $explorer = iconTable('explorer-64.png', '{explorer}', '{explorer_browse_yours_files}', "Loadjs('tree.php')", null, 210, null, 0, true); $users = new usersMenus(); if ($users->SAMBA_INSTALLED) { $shareAfolder = iconTable('folder-granted-64.png', '{SHARE_FOLDER}', '{SHARE_A_FOLDER_USER_TEXT}', "Loadjs('share-a-folder.php')", null, 210, null, 0, true); } if ($users->MLDONKEY_INSTALLED) { $ml = new EmuleTelnet(); if ($ml->UserIsActivated($_SESSION["uid"])) { $mldonkey = iconTable('64-emule.png', '{PEER_TO_PEER_NETWORKS}', '{PEER_TO_PEER_NETWORKS_TEXT}', "Loadjs('donkey.php')", null, 210, null, 0, true); } } else { writelogs("MLDONKEY_INSTALLED return false", __FUNCTION__, __FILE__, __LINE__); } $ct = new user($_SESSION["uid"]); writelogs("WebDavUser={$ct->WebDavUser}", __FUNCTION__, __FILE__, __LINE__); if ($ct->WebDavUser == 1) { $apache = new vhosts(); print_r($hash); $hash = $apache->LoadVhostsType($ct->ou); if ($hash["WEBDAV"]) { $webdav = iconTable('webdav-64.png', '{WEBDAV_HOWTO}', '{WEBDAV_HOWTO_TEXT}', "Loadjs('webdav.php')", null, 210, null, 0, true); } } $html = "<H1>{storage}:{$_SESSION["ou"]}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$explorer}{$shareAfolder}" . storage_icon() . "</td>\n\t\t<td valign='top'>" . Xapian() . "{$mldonkey}{$webdav}</td>\n\t</tr>\n\t</table>\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function SaveInfos() { $emule = new EmuleTelnet(); $uid = $_GET["uid"]; if (!$emule->ok) { echo $emule->errstr; return; } $MldonkeyActivate = $_GET["MldonkeyActivate"]; unset($_SESSION["MLDONKEY_{$uid}"]); if ($MldonkeyActivate == 0) { $emule->UserDelete($uid); return; } else { $emule->UserAdd($uid, $_GET["max_downloads"]); } }
function mldonkey_status() { $users = new usersMenus(); $tpl = new templates(); $sock = new sockets(); if (!$users->MLDONKEY_INSTALLED) { return false; } $EnableMLDonKey = $sock->GET_INFO("EnableMLDonKey"); if ($EnableMLDonKey == null) { $EnableMLDonKey = 1; } if ($EnableMLDonKey == 0) { return null; } include_once dirname(__FILE__) . "/ressources/class.donkey.inc"; $ml = new EmuleTelnet(); if (!$ml->UserIsActivated($_SESSION["uid"])) { return; } $array = $ml->download_queue($_SESSION["uid"]); if (!is_array($array["INFOS"]["LIST"])) { return; } $count = 0; while (list($num, $array_2) = each($array["INFOS"]["LIST"])) { $count = $count + 1; $js = "Loadjs('donkey.php');"; $color = "black"; $unit_rate = " Ko/s"; if ($array_2["RATE"] == "Paused") { $color = "red"; $unit_rate = null; } $array_2["FILE"] = wordwrap($array_2["FILE"], 30, " ", true); $html = $html . "\n\t<tr " . CellRollOver($js, $textToolTip) . ">\n\t\t<td width=1%><img src='img/forwd_18.gif'></td>\n\t\t<td><strong style='color:{$color}'>{$array_2["FILE"]}</td>\n\t\t<td width=1% style='color:{$color}'>{$array_2["POURC_ACCOMPLISH"]}%</td>\n\t\t\n\t</tr>\n\t\t\n\t\t\n\t"; } if ($count == 0) { return; } $title = "{download_list}"; $html = iconTable("", "{$title}", "{$html}"); echo $tpl->_ENGINE_parse_body($html); }
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"); }
function popup_bandwith() { $page = CurrentPageName(); $ml = new EmuleTelnet(); $array = $ml->parameters(); $tpl = new templates(); $schedule = $tpl->_ENGINE_parse_body("{schedule}"); $html = "\n\t<div style='font-size:14px;margin:9px'>{edonkey_bandwith_explain}</div>\n\t<H3>{current_parameters}</H3>\n\t\n\t<strong style='font-size:12px'>{max_hard_upload_rate}:{$array["max_hard_upload_rate"]} kb/s |\n\t{max_hard_download_rate}:{$array["max_hard_download_rate"]} Kb/s</strong>\n\t<hr>\n\t\t<div style='text-align:right'>" . button("{add_schedule_parameter}", "AddScheduleEDonkey(0)") . "</div>\n\t\n\t\t<div id='edonkey_bandwith_list' style='height:400px;overflow:auto;margin-top:9px'></div>\n\t\n\t\n\t<script>\n\t\tfunction AddScheduleEDonkey(id){\n\t\t\tYahooWin3('550','{$page}?schedule-parameter='+id,'{$schedule}');\n\t\t}\n\t\t\n\t\tfunction RefreshSchedList(){\n\t\t\tLoadAjax('edonkey_bandwith_list','{$page}?schedule-parameter-list=yes');\n\t\t}\n\t\t\n\tvar X_SaveParametersSCH= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.lenght>0){alert(results);}\n\t\tYahooWin3Hide();\n\t\tRefreshSchedList();\n\t\t}\t\t\n\t\t\n\tfunction DelScheduleEDonkey(ID){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DelScheduleEDonkey',ID);\n\t\tdocument.getElementById('edonkey_bandwith_list').innerHTML='<center><img src=img/wait_verybig.gif></center>'\n\t\tXHR.sendAndLoad('{$page}', 'GET',X_SaveParametersSCH);\t\n\t}\t\t\n\t\t\n\tRefreshSchedList();\n\t</script>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }