Exemple #1
0
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 popup()
{
    $emule = new EmuleTelnet();
    $uid = $_GET["uid"];
    if (!$emule->ok) {
        echo "<center style='font-size:16px;color:#d32d2d'>{$emule->errstr}</center>";
        return;
    }
    if (!$emule->UserIsActivated($uid)) {
        $enabled = 0;
    } else {
        $enabled = 1;
    }
    $max_downloads = $emule->HASH_USERS[$uid]["MAX_DOWNLOADS"];
    $field = Paragraphe_switch_img("{ACTIVATE_THIS_MLDONKEY_USER}", "{ACTIVATE_THIS_MLDONKEY_USER_TEXT}", "MldonkeyActivate", $enabled, 330);
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/128-emule.png' id='emule-image'></td>\n\t<td valing='top'>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td>{$field}</td>\n\t</tr>\n\t<tr>\n\t<td>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:13px'>{max_downloads}:</td>\n\t\t\t\t<td>" . Field_text("max_downloads", $max_downloads, "font-size:13px;padding:3px;width:60px") . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t</td>\n\t<tr>\n\t\t<td align='right'><hr>" . button("{apply}", "SaveeMuleEnabledUser()") . "</td>\n\t</tr>\n\t</table>\t\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #3
0
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 = "&nbsp;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);
}