コード例 #1
0
/**
 * builds page
 *
 */
function buildPage($action)
{
    global $cfg, $statusImage, $statusMessage, $htmlTitle, $htmlTop, $htmlMain;
    // navi
    $htmlTop .= '<a href="' . _FILE_THIS . '?t=0">Torrents</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?b=0">Backup</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?m=0">Maintenance</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?q=0">tfqmgr</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=1">Help</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=0">Version</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=5">News</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=2">Changelog</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=3" target="_blank">Issues</a>';
    $htmlTop .= ' | ';
    $htmlTop .= '<a href="' . _FILE_THIS . '?a=4">Update</a>';
    // body
    switch ($action) {
        case "b":
            // backup passthru
            $statusImage = "yellow.gif";
            break;
        case "-b":
            // backup-error passthru
            $statusImage = "red.gif";
            break;
        case "-u":
            // update-error passthru
            $statusImage = "red.gif";
            $htmlTitle = "Update";
            $htmlMain = '<br><font color="red"><strong>Update from your Version not possible.</strong></font>';
            $htmlMain .= '<br><br>';
            $htmlMain .= 'Please use the most recent tarball and perform a manual update.';
            $htmlMain .= '<br>';
            //$htmlMain .= '<br><br>';
            //$htmlMain .= getReleaseList();
            break;
        case "q":
            // queue passthru
            $statusImage = "black.gif";
            $htmlMain .= '<table width="100%" bgcolor="' . $cfg["table_data_bg"] . '" border="0" cellpadding="4" cellspacing="0"><tr><td width="100%">';
            $htmlMain .= '<a href="' . _FILE_THIS . '?q=1">log</a>';
            $htmlMain .= ' | ';
            $htmlMain .= '<a href="' . _FILE_THIS . '?q=2">ps</a>';
            include_once "QueueManager.php";
            $queueManager = QueueManager::getQueueManagerInstance($cfg);
            if ($queueManager->isQueueManagerRunning() && $queueManager->managerName == "tfqmgr") {
                $htmlMain .= ' | ';
                $htmlMain .= '<a href="' . _FILE_THIS . '?q=3">status</a>';
            }
            $htmlMain .= '</td><td align="right"><strong>tfqmgr</td>';
            $htmlMain .= '</td></tr></table>';
            break;
        case "m":
            // maintenance passthru
            $statusImage = "black.gif";
            $htmlMain .= '<table width="100%" bgcolor="' . $cfg["table_data_bg"] . '" border="0" cellpadding="4" cellspacing="0"><tr><td width="100%">';
            $htmlMain .= '<a href="' . _FILE_THIS . '?m=1">clean</a>';
            $htmlMain .= ' | ';
            $htmlMain .= '<a href="' . _FILE_THIS . '?m=2">kill</a>';
            $htmlMain .= ' | ';
            $htmlMain .= '<a href="' . _FILE_THIS . '?m=3">repair</a>';
            $htmlMain .= '</td><td align="right"><strong>Maintenance</td>';
            $htmlMain .= '</td></tr></table>';
            break;
        case "t":
            // torrent passthru
            $statusImage = "black.gif";
            $htmlMain .= '<table width="100%" bgcolor="' . $cfg["table_data_bg"] . '" border="0" cellpadding="4" cellspacing="0"><tr><td width="100%">';
            $htmlMain .= '<a href="' . _FILE_THIS . '?t=1">Stop All Torrents</a>';
            $htmlMain .= ' | ';
            $htmlMain .= '<a href="' . _FILE_THIS . '?t=2">Start All Torrents</a>';
            $htmlMain .= ' | ';
            $htmlMain .= '<a href="' . _FILE_THIS . '?t=3">Resume All Torrents</a>';
            $htmlMain .= '</td><td align="right"><strong>Torrents</td>';
            $htmlMain .= '</td></tr></table>';
            break;
        case "0":
            // version
            $htmlTitle = "Version";
            // version-check
            $versionAvailable = trim(getDataFromUrl(_SUPERADMIN_URLBASE . _VERSION_REMOTE));
            if (isset($versionAvailable) && $versionAvailable != "") {
                // set image
                if ($versionAvailable == _VERSION_THIS || substr(_VERSION_THIS, 0, 3) == "svn") {
                    $statusImage = "green.gif";
                } else {
                    $statusImage = "red.gif";
                }
                // version-text
                $htmlMain .= '<br>';
                if (substr(_VERSION_THIS, 0, 3) == "svn") {
                    $htmlMain .= '<strong>This Version : </strong>' . _VERSION_THIS;
                    $htmlMain .= '<br><br>';
                    $htmlMain .= '<strong>Available Version : </strong>';
                    $htmlMain .= $versionAvailable;
                    $htmlMain .= '<br><br>';
                    $htmlMain .= '<font color="blue">This Version is a svn-Version.</font>';
                } else {
                    if ($versionAvailable != _VERSION_THIS) {
                        $htmlMain .= '<strong>This Version : </strong>';
                        $htmlMain .= '<font color="red">' . _VERSION_THIS . '</font>';
                        $htmlMain .= '<br><br>';
                        $htmlMain .= '<strong>Available Version : </strong>';
                        $htmlMain .= $versionAvailable;
                        $htmlMain .= '<br><br>';
                        $htmlMain .= '<strong><font color="red">There is a new Version available !</font></strong>';
                        $htmlMain .= '<br><br>';
                        $htmlMain .= '<strong>Homepage : </strong>';
                        $htmlMain .= '<br>';
                        $htmlMain .= '<a href="' . _URL_HOME . '" target="_blank">' . _URL_HOME . '</a>';
                        //$htmlMain .= '<br><br>';
                        //$htmlMain .= getReleaseList();
                    } else {
                        $htmlMain .= '<strong>This Version : </strong>' . _VERSION_THIS;
                        $htmlMain .= '<br><br>';
                        $htmlMain .= '<strong>Available Version : </strong>';
                        $htmlMain .= $versionAvailable;
                        $htmlMain .= '<br><br>';
                        $htmlMain .= '<font color="green">This Version looks good.</font>';
                    }
                }
                $htmlMain .= '<br><br>';
            } else {
                // could not get the version
                $statusImage = "black.gif";
                $htmlTop = '<strong><font color="red">Error.</font></strong>';
                $htmlMain = '<br>';
                $htmlMain .= '<font color="red">Error getting available version.</font>';
                $htmlMain .= '<br><br>';
                $htmlMain .= '<strong>Homepage : </strong>';
                $htmlMain .= '<br>';
                $htmlMain .= '<a href="' . _URL_HOME . '" target="_blank">' . _URL_HOME . '</a>';
                $htmlMain .= '<br>';
            }
            break;
        case "1":
            // help
            $htmlTitle = "Help";
            $htmlMain .= '<br><p>';
            $htmlMain .= '<strong>For Help with this Version check Homepage on berliOS :</strong>';
            $htmlMain .= '<p>';
            $htmlMain .= '<a href="' . _URL_HOME . '" target="_blank"><img src="images/arrow.gif" width="9" height="9" title="Homepage on berliOS" border="0"> ' . _URL_HOME . '</a>';
            $htmlMain .= '<br><br>';
            break;
        case "2":
            // changelog
            $htmlTitle = "Changelog";
            $htmlMain .= '<br>';
            $htmlMain .= '<h4>Changelog<h4>';
            $htmlMain .= '<hr>';
            $htmlMain .= '<pre>';
            $htmlMain .= gzinflate(getDataFromUrl(_SUPERADMIN_URLBASE . _SUPERADMIN_PROXY . "?a=1"));
            $htmlMain .= '</pre>';
            break;
        case "3":
            // issues
            $htmlTitle = "Issues";
            $issueText = "Error getting issues";
            $issueText = gzinflate(getDataFromUrl(_SUPERADMIN_URLBASE . _SUPERADMIN_PROXY . "?a=2"));
            header("Content-Type: text/plain");
            echo $issueText;
            exit;
            break;
        case "4":
            // update
            $htmlTitle = "Update";
            // version-check
            $versionAvailable = trim(getDataFromUrl(_SUPERADMIN_URLBASE . _VERSION_REMOTE));
            if (isset($versionAvailable) && $versionAvailable != "") {
                // set image
                if ($versionAvailable == _VERSION_THIS) {
                    $statusImage = "green.gif";
                } else {
                    $statusImage = "red.gif";
                }
                // version-text
                $htmlMain .= '<br>';
                if ($versionAvailable != _VERSION_THIS) {
                    $htmlMain .= '<form name="update" action="' . _FILE_THIS . '" method="post">';
                    $htmlMain .= '<input type="Hidden" name="u" value="0">';
                    $htmlMain .= '<input type="submit" value="Update to Version ' . $versionAvailable . '">';
                    $htmlMain .= '</form><p>';
                }
            }
            $htmlMain .= '<strong>Homepage : </strong>';
            $htmlMain .= '<br>';
            $htmlMain .= '<a href="' . _URL_HOME . '" target="_blank"><img src="images/arrow.gif" width="9" height="9" title="Homepage on berliOS" border="0"> ' . _URL_HOME . '</a>';
            //$htmlMain .= '<br><br>';
            //$htmlMain .= getReleaseList();
            break;
        case "5":
            // news
            $htmlTitle = "News";
            $htmlMain .= '<br>';
            $htmlMain .= '<h4>News<h4>';
            $htmlMain .= '<hr>';
            $htmlMain .= gzinflate(getDataFromUrl(_SUPERADMIN_URLBASE . _SUPERADMIN_PROXY . "?a=0"));
            break;
        default:
            $htmlTitle = "SuperAdmin";
            $statusImage = "black.gif";
            $htmlMain = '<br>';
            break;
    }
}
コード例 #2
0
 /**
  * do start of a bittorrent-client.
  */
 function doStartTorrentClient()
 {
     include_once "AliasFile.php";
     if ($this->status != 2) {
         $this->status = -1;
         $this->messages .= "Error. ClientHandler in wrong state on execStart-request.";
         return;
     }
     // write the session to close so older version of PHP will not hang
     session_write_close("TorrentFlux");
     $torrentRunningFlag = 1;
     if ($this->af->running == "3") {
         // _queue_
         //writeQinfo($this->cfg["torrent_file_path"]."queue/".$this->alias.".stat",$this->command);
         include_once "QueueManager.php";
         $queueManager = QueueManager::getQueueManagerInstance($this->cfg);
         $queueManager->command = $this->command;
         // tfQmanager...
         $queueManager->enqueueTorrent($this->torrent);
         AuditAction($this->cfg["constants"]["queued_torrent"], $this->torrent . "<br>Die:" . $this->runtime . ", Sharekill:" . $this->sharekill . ", MaxUploads:" . $this->maxuploads . ", DownRate:" . $this->drate . ", UploadRate:" . $this->rate . ", Ports:" . $this->minport . "-" . $this->maxport . ", SuperSeed:" . $this->superseeder . ", Rerequest Interval:" . $this->rerequest);
         AuditAction($this->cfg["constants"]["queued_torrent"], $this->command);
         $torrentRunningFlag = 0;
     } else {
         // The following command starts the torrent running! w00t!
         //system('echo command >> /tmp/fluxi.debug; echo "'. $this->command .'" >> /tmp/fluxi.debug');
         $this->callResult = exec($this->command);
         AuditAction($this->cfg["constants"]["start_torrent"], $this->torrent . "<br>Die:" . $this->runtime . ", Sharekill:" . $this->sharekill . ", MaxUploads:" . $this->maxuploads . ", DownRate:" . $this->drate . ", UploadRate:" . $this->rate . ", Ports:" . $this->minport . "-" . $this->maxport . ", SuperSeed:" . $this->superseeder . ", Rerequest Interval:" . $this->rerequest);
         // slow down and wait for thread to kick off.
         // otherwise on fast servers it will kill stop it before it gets a chance to run.
         sleep(1);
         $torrentRunningFlag = 1;
     }
     if ($this->messages == "") {
         // Save torrent settings
         saveTorrentSettings($this->torrent, $torrentRunningFlag, $this->rate, $this->drate, $this->maxuploads, $this->runtime, $this->sharekill, $this->minport, $this->maxport, $this->maxcons, $this->savepath, $this->handlerName);
         $this->status = 3;
     } else {
         AuditAction($this->cfg["constants"]["error"], $this->messages);
         $this->status = -1;
     }
 }
コード例 #3
0
         }
         include_once "ClientHandler.php";
         $clientHandler = ClientHandler::getClientHandlerInstance($cfg, $btclient);
         $clientHandler->startTorrentClient(urldecode($element), 0);
         // just a sec..
         sleep(1);
     }
     break;
 case "torrentDeQueue":
     /* torrentDeQueue */
     if ($torrentRunningFlag == 0) {
         // set request var
         $_REQUEST['alias_file'] = getAliasName($element) . ".stat";
         // dequeue it
         include_once "QueueManager.php";
         $queueManager = QueueManager::getQueueManagerInstance($cfg);
         $queueManager->dequeueTorrent($element);
         // just a sec..
         sleep(1);
     }
     break;
 case "torrentResetTotals":
     /* torrentResetTotals */
     resetTorrentTotals(urldecode($element), false);
     break;
 default:
     if ($torrentRunningFlag != 0) {
         // stop torrent first
         $clientHandler = ClientHandler::getClientHandlerInstance($cfg, $btclient);
         $clientHandler->stopTorrentClient(urldecode($element), $alias);
         // give the torrent some time to die
コード例 #4
0
function queueSettings()
{
    global $cfg;
    include_once "AliasFile.php";
    include_once "RunningTorrent.php";
    include_once "QueueManager.php";
    $queueManager = QueueManager::getQueueManagerInstance($cfg);
    // QueueManager Running ?
    $queueManagerRunning = false;
    $shutdown = getRequestVar('s');
    if (isset($shutdown) && $shutdown == "1") {
        $queueManagerRunning = false;
    } else {
        if ($queueManager->isQueueManagerRunning()) {
            $queueManagerRunning = true;
        } else {
            if ($queueManager->managerName == "tfqmgr") {
                if ($queueManager->isQueueManagerReadyToStart()) {
                    $queueManagerRunning = false;
                } else {
                    $queueManagerRunning = true;
                }
            } else {
                $queueManagerRunning = false;
            }
        }
    }
    // head
    DisplayHead("Administration - Queue Settings");
    // Admin Menu
    displayMenu();
    // message section
    $message = getRequestVar('m');
    if (isset($message) && $message != "") {
        echo '<table cellpadding="5" cellspacing="0" border="0" width="100%">';
        echo '<tr><td align="center" bgcolor="' . $cfg["table_header_bg"] . '"><strong>';
        echo urldecode($message);
        echo '</strong></td></tr></table>';
    }
    // Queue Manager Section
    echo "<div align=\"center\">";
    echo "<a name=\"QManager\" id=\"QManager\"></a>";
    echo "<table width=\"100%\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
    echo "<tr><td bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
    echo "<font class=\"title\">";
    //if(checkQManager() > 0)
    //	   echo "&nbsp;&nbsp;<img src=\"images/green.gif\" align=\"absmiddle\" align=\"absmiddle\"> Queue Manager Running [PID=".getQManagerPID()." with ".strval(getRunningTorrentCount())." torrent(s)]";
    if ($queueManagerRunning) {
        echo "&nbsp;&nbsp;<img src=\"images/green.gif\" align=\"absmiddle\" align=\"absmiddle\"> Queue Manager Running (" . $queueManager->managerName . "; pid: " . $queueManager->getQueueManagerPid() . ")";
    } else {
        echo "&nbsp;&nbsp;<img src=\"images/black.gif\" align=\"absmiddle\"> Queue Manager Off";
    }
    echo "</font>";
    echo "</td></tr><tr><td align=\"center\">";
    ?>
	<script language="JavaScript">
	function validateSettings()
	{
		var rtnValue = true;
		var msg = "";
		if (isNumber(document.theForm.maxServerThreads.value) == false)
		{
			msg = msg + "* Max Server Threads must be a valid number.\n";
			document.theForm.maxServerThreads.focus();
		}
		if (isNumber(document.theForm.maxUserThreads.value) == false)
		{
			msg = msg + "* Max User Threads must be a valid number.\n";
			document.theForm.maxUserThreads.focus();
		}
		if (isNumber(document.theForm.sleepInterval.value) == false)
		{
			msg = msg + "* Sleep Interval must be a valid number.\n";
			document.theForm.sleepInterval.focus();
		}

		if (msg != "")
		{
			rtnValue = false;
			alert("Please check the following:\n\n" + msg);
		}

		return rtnValue;
	}
	function isNumber(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber = true;
		var Char;

		for (i = 0; i < sText.length && IsNumber == true; i++)
		{
			Char = sText.charAt(i);
			if (ValidChars.indexOf(Char) == -1)
			{
				IsNumber = false;
			}
		}

		return IsNumber;
	}
	</script>
	<div align="center">

		<table cellpadding="5" cellspacing="0" border="0" width="100%">

<?php 
    //if ((! $queueManager->isQueueManagerRunning()) && ( !$queueManager->isQueueManagerReadyToStart())) {
    if (isset($shutdown) && $shutdown == "1") {
        echo '<tr><br>';
        echo '<td align="center" colspan="2">';
        echo 'QueueManager going down... Please Wait.';
        echo '<br><br></td>';
        echo '</tr>';
    } else {
        echo '<form name="controlForm" action="admin.php?op=controlQueueManager" method="post">';
        if ($queueManagerRunning) {
            echo '<input type="Hidden" name="a" value="stop">';
            echo '<tr><br>';
            echo '<td align="center" colspan="2">';
            echo '<input type="Submit" value="Stop QueueManager">';
            echo '<br><br></td>';
            echo '</tr>';
        } else {
            echo '<input type="Hidden" name="a" value="start">';
            echo '<tr>';
            echo '<td align="left" width="350" valign="top"><strong>Choose Queue Manager</strong><br>';
            echo '<u>Note</u> : tfQManager only supports tornado-clients.';
            echo '</td>';
            echo '<td>';
            echo '<select name="queuemanager">';
            echo '<option value="tfqmgr"';
            if ($cfg["queuemanager"] == "tfqmgr") {
                echo " selected";
            }
            echo '>tfqmgr</option>';
            echo '<option value="Qmgr"';
            if ($cfg["queuemanager"] == "Qmgr") {
                echo " selected";
            }
            echo '>Qmgr</option>';
            echo '<option value="tfQManager"';
            if ($cfg["queuemanager"] == "tfQManager") {
                echo " selected";
            }
            echo '>tfQManager</option>';
            echo '</select>';
            echo '</td>';
            echo '</tr>';
            echo '<tr>';
            echo '<td align="center" colspan="2">';
            echo '<input type="Submit" value="Start QueueManager">';
            echo '<br><br></td>';
            echo '</tr>';
        }
        echo '</form>';
    }
    ?>

			<form name="theForm" action="admin.php?op=updateQueueSettings" method="post" onsubmit="return validateSettings()">

			<tr>
			 <td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
">
			  <strong>tfqmgr</strong>&nbsp;
			  <?php 
    echo '(';
    printSuperAdminLink('?q=1', 'log');
    echo ' | ';
    printSuperAdminLink('?q=2', 'ps');
    if (isset($shutdown) && $shutdown == "1") {
    } else {
        if ($queueManagerRunning && $queueManager->managerName == "tfqmgr") {
            echo ' | ';
            printSuperAdminLink('?q=3', 'status');
        }
    }
    echo ' )';
    ?>
			 </td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>perl Path</strong><br>
				Specify the path to perl (/usr/bin/perl):
				</td>
				<td valign="top">
					<input name="perlCmd" type="Text" maxlength="254" value="<?php 
    echo $cfg["perlCmd"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["perlCmd"]);
    ?>
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>tfqmgr Path</strong><br>
				Specify the path of tfqmgr (/var/www/tfqmgr):
				</td>
				<td valign="top">
					<input name="tfqmgr_path" type="Text" maxlength="254" value="<?php 
    echo $cfg["tfqmgr_path"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["tfqmgr_path"] . "/tfqmgr.pl");
    ?>
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>fluxcli Path</strong><br>
				Specify the path where fluxcli.php is. (/var/www):
				</td>
				<td valign="top">
					<input name="tfqmgr_path_fluxcli" type="Text" maxlength="254" value="<?php 
    echo $cfg["tfqmgr_path_fluxcli"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["tfqmgr_path_fluxcli"] . "/fluxcli.php");
    ?>
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>Limit Torrent Global</strong><br>
				Specify the maximum number of torrents the server will allow to run at one time (admins may override this):
				</td>
				<td valign="top">
					<input name="tfqmgr_limit_global" type="Text" maxlength="3" value="<?php 
    echo $cfg["tfqmgr_limit_global"];
    ?>
" size="3">
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>Limit Torrent Per User</strong><br>
				Specify the maximum number of torrents a single user may run at one time:
				</td>
				<td valign="top">
					<input name="tfqmgr_limit_user" type="Text" maxlength="3" value="<?php 
    echo $cfg["tfqmgr_limit_user"];
    ?>
" size="3">
				</td>
			</tr>

			<tr><td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
"><strong>Qmgr</strong></td></tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Path to Qmgr scripts</strong><br>
			   Specify the path to the Qmgr.pl and Qmgrd.pl scripts:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_path" type="Text" maxlength="254" value="<?php 
    echo $cfg["Qmgr_path"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["Qmgr_path"] . "/Qmgrd.pl");
    ?>
			   </td>
			</tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Max User Torrents</strong><br>
			   Total number of torrents to allow a single user at once:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_maxUserTorrents" type="Text" maxlength="3" value="<?php 
    echo $cfg["Qmgr_maxUserTorrents"];
    ?>
" size="3">
			   </td>
			</tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Max Total Torrents</strong><br>
			   Total number of torrents the server will run at once:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_maxTotalTorrents" type="Text" maxlength="3" value="<?php 
    echo $cfg["Qmgr_maxTotalTorrents"];
    ?>
" size="3">
			   </td>
			</tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Perl's Path</strong><br>
			   Specify the path to perl:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_perl" type="Text" maxlength="254" value="<?php 
    echo $cfg["Qmgr_perl"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["Qmgr_perl"]);
    ?>
			   </td>
			</tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Fluxcli.php path</strong><br>
			   Specify the path to the fluxcli executable:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_fluxcli" type="Text" maxlength="254" value="<?php 
    echo $cfg["Qmgr_fluxcli"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["Qmgr_fluxcli"] . "/fluxcli.php");
    ?>
			   </td>
			</tr>
			<tr>
			   <td align="left" width="350" valign="top"><strong>Qmgrd host</strong><br>
			   The host running the Qmgrd.pl script, probably localhost:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_host" type="Text" maxlength="254" value="<?php 
    echo $cfg["Qmgr_host"];
    ?>
" size="15">
			   </td>
			</tr>
			<tr>
			   <td align="left" width="250" valign="top"><strong>Qmgrd port</strong><br>
			   the port number to run the Qmgrd.pl script on:
			   </td>
			   <td valign="top">
				   <input name="Qmgr_port" type="Text" maxlength="5" value="<?php 
    echo $cfg["Qmgr_port"];
    ?>
" size="5">
			   </td>
			</tr>

			<tr><td colspan="2" align="center" bgcolor="<?php 
    echo $cfg["table_header_bg"];
    ?>
"><strong>tfQManager</strong></td></tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>tfQManager Path</strong><br>
				Specify the path to the tfQManager.py python script:
				</td>
				<td valign="top">
					<input name="tfQManager" type="Text" maxlength="254" value="<?php 
    echo $cfg["tfQManager"];
    ?>
" size="55"><?php 
    echo validateFile($cfg["tfQManager"]);
    ?>
				</td>
			</tr>

			<tr>
				<td align="left" width="350" valign="top"><strong>Max Server Threads</strong><br>
				Specify the maximum number of torrents the server will allow to run at
				one time (admins may override this):
				</td>
				<td valign="top">
					<input name="maxServerThreads" type="Text" maxlength="3" value="<?php 
    echo $cfg["maxServerThreads"];
    ?>
" size="3">
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>Max User Threads</strong><br>
				Specify the maximum number of torrents a single user may run at
				one time:
				</td>
				<td valign="top">
					<input name="maxUserThreads" type="Text" maxlength="3" value="<?php 
    echo $cfg["maxUserThreads"];
    ?>
" size="3">
				</td>
			</tr>
			<tr>
				<td align="left" width="350" valign="top"><strong>Polling Interval</strong><br>
				Number of seconds the Queue Manager will sleep before checking for new torrents to run:
				</td>
				<td valign="top">
					<input name="sleepInterval" type="Text" maxlength="3" value="<?php 
    echo $cfg["sleepInterval"];
    ?>
" size="3">
				</td>
			</tr>
			<tr><td colspan="2"><hr noshade></td></tr>
			<tr>
				<td align="center" colspan="2">
				<input type="Submit" value="Update Settings">
				</td>
			</tr>
			</form>
		</table>


		</div>
	<br>
<?php 
    echo "</td></tr>";
    echo "</table></div>";
    $displayQueue = True;
    $displayRunningTorrents = True;
    // Its a timming thing.
    if ($displayRunningTorrents) {
        // get Running Torrents.
        $runningTorrents = getRunningTorrents();
    }
    // _queue_
    if ($displayQueue) {
        echo "\n";
        echo "<table width=\"760\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
        echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
        echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr>";
        echo "<td><img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\"> Queued Items </font></td>";
        echo "</tr></table>";
        echo "</td></tr>";
        echo "<tr>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"15%\"><div align=center class=\"title\">" . _USER . "</div></td>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _FILE . "</div></td>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"15%\"><div align=center class=\"title\">" . _TIMESTAMP . "</div></td>";
        echo "</tr>";
        echo "\n";
        echo $queueManager->formattedQueueList();
        echo "</table>";
    }
    // _queue_
    if ($displayRunningTorrents) {
        $output = "";
        echo "\n";
        echo "<table width=\"760\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
        echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
        echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr>";
        echo "<td><img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\"> Running Items </font></td>";
        echo "</tr></table>";
        echo "</td></tr>";
        echo "<tr>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"15%\"><div align=center class=\"title\">" . _USER . "</div></td>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _FILE . "</div></td>";
        echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"1%\"><div align=center class=\"title\">" . str_replace(" ", "<br>", _FORCESTOP) . "</div></td>";
        echo "</tr>";
        echo "\n";
        // get running tornado torrents and List them out.
        $runningTorrents = getRunningTorrents("tornado");
        foreach ($runningTorrents as $key => $value) {
            $rt = RunningTorrent::getRunningTorrentInstance($value, $cfg, "tornado");
            $output .= $rt->BuildAdminOutput();
        }
        // get running transmission torrents and List them out.
        $runningTorrents = getRunningTorrents("transmission");
        foreach ($runningTorrents as $key => $value) {
            $rt = RunningTorrent::getRunningTorrentInstance($value, $cfg, "transmission");
            $output .= $rt->BuildAdminOutput();
        }
        if (strlen($output) == 0) {
            $output = "<tr><td colspan=3><div class=\"tiny\" align=center>No Running Torrents</div></td></tr>";
        }
        echo $output;
        echo "</table>";
    }
    DisplayFoot(true, true);
}