Beispiel #1
0
/* action */
$action = "---";
if (isset($_POST["action"])) {
    $action = $_POST["action"];
}
switch ($action) {
    /* ---------------------------------------------------------------- dummy */
    case "---":
        break;
        /* ---------------------------------------------------------- dir-methods */
    /* ---------------------------------------------------------- dir-methods */
    case "fileDelete":
        /* fileDelete */
        foreach ($_POST['file'] as $key => $element) {
            $element = urldecode($element);
            delDirEntry($element);
        }
        break;
        /* --------------------------------------------------------- all torrents */
    /* --------------------------------------------------------- all torrents */
    case "bulkStop":
        /* bulkStop */
        $torrents = getTorrentListFromFS();
        foreach ($torrents as $torrent) {
            $torrentRunningFlag = isTorrentRunning($torrent);
            if ($torrentRunningFlag != 0) {
                $owner = getOwner($torrent);
                if (isset($owner) && $owner == $cfg["user"]) {
                    $alias = getAliasName($torrent) . ".stat";
                    $btclient = getTorrentClient($torrent);
                    $clientHandler = ClientHandler::getClientHandlerInstance($cfg, $btclient);
Beispiel #2
0
    You should have received a copy of the GNU General Public License
    along with TorrentFlux; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
include_once "config.php";
include_once "functions.php";
checkUserPath();
// Setup some defaults if they are not set.
$del = getRequestVar('del');
$down = getRequestVar('down');
$tar = getRequestVar('tar');
$dir = stripslashes(urldecode(getRequestVar('dir')));
// -----------------------------------------------------------------------------
// Are we to delete something?
if ($del != "") {
    $current = delDirEntry($del);
    header("Location: dir.php?dir=" . urlencode($current));
}
// Are we to download something?
if ($down != "" && $cfg["enable_file_download"]) {
    $current = "";
    // Yes, then download it
    // we need to strip slashes twice in some circumstances
    // Ex.  If we are trying to download test/tester's file/test.txt
    // $down will be "test/tester\\\'s file/test.txt"
    // one strip will give us "test/tester\'s file/test.txt
    // the second strip will give us the correct
    //  "test/tester's file/test.txt"
    $down = stripslashes(stripslashes($down));
    if (!ereg("(\\.\\.\\/)", $down)) {
        $path = $cfg["path"] . $down;