TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
06-27-2007, 13:17:42
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  [TF21] Specific save path
« previous next »
Pages: 1 [2] 3 4 Go Down Reply Notify of replies Send this topic Print
Author Topic: [TF21] Specific save path  (Read 6161 times)
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #15 on: 04-10-2006, 01:22:59 » Reply with quote

Code:
[code]Imagine your download folder is like this:

[CODE]
/Downloads/
/Downloads/Anime/
/Downloads/Anime/serie1/
/Downloads/Anime/serie1/season1/
/Downloads/Anime/serie1/season1/a_subfolder/
/Downloads/Anime/serie1/season2/
/Downloads/Anime/serie2/
/Downloads/Linux/
/Downloads/Linux/Gentoo/
/Downloads/Linux/Gentoo/2005-r1/
/Downloads/Linux/Gentoo/2006-r0/
/Downloads/Linux/Ubuntu/
/Downloads/Linux/Ubuntu/release1/
/Downloads/Linux/Ubuntu/release2/
and so on with lots of other folders and subfolders and sub-subfolders...

Max depth = 0: it displays all folders and subfolders and sub-subfolders and so on...
Max depth = 1: it displays:
Code:
/Downloads/
/Downloads/Anime/
/Downloads/Linux/

Max depth = 2: it displays
Code:
/Downloads/
/Downloads/Anime/
/Downloads/Anime/serie1/
/Downloads/Anime/serie2/
/Downloads/Linux/
/Downloads/Linux/Gentoo/
/Downloads/Linux/Ubuntu/

Max depth = 3: it displays:
Code:
/Downloads/
/Downloads/Anime/
/Downloads/Anime/serie1/
/Downloads/Anime/serie1/season1/
/Downloads/Anime/serie1/season2/
/Downloads/Anime/serie2/
/Downloads/Linux/
/Downloads/Linux/Gentoo/
/Downloads/Linux/Gentoo/2005-r1/
/Downloads/Linux/Gentoo/2006-r0/
/Downloads/Linux/Ubuntu/
/Downloads/Linux/Ubuntu/release1/
/Downloads/Linux/Ubuntu/release2/

And so on...

Max depth = 0 displays all.

So, the greater maxdepth (or maxdepth = 0 for unlimited depth): the more in-depth it goes to display folders and their subfolders, so you can specify with precision where you want to save your download, but it may take longer to find the right one in the list, because there are lots of folders and subfolders.
If maxdepth = 1 or 2: it just displays "categories" and perhaps, if maxdepth=2, subcategories, so it's already quite precise to put your downloads, and quicker to pick-up the right subfolder as the list is shorter than a complete or more in-depth display.

I hope I was understandable Smiley[/code][/code]
« Last Edit: 04-10-2006, 01:27:45 by coldfire » Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #16 on: 04-10-2006, 01:55:59 » Reply with quote

Thanks for the explanation.

It seems that no matter what I set max depth at I get the same thing.  I set it to 4 or 0 and the same ammount of folders show up.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #17 on: 04-10-2006, 02:03:15 » Reply with quote

Alright, I figured it out.

I'm not sure if I will use this hack.  I host web sites on my server as well and they are all in /home/ and my TF server is an account in /home/.

My TF users would be able to download to any web site on my entire box.  I'm not sure how secure that is.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #18 on: 04-10-2006, 02:33:44 » Reply with quote

The download path starts at $cfg['path'].getOwner($torrent)


So they just can go in their respective download folder. They can't go up then go in another user's folder.
For example, if $cfg["path"] is "/var/www/" and you have user1 and user2,
user1 will only see what is in /var/www/user1" and user2 will only see what's in "/var/www/user2". But no user will be able to go up to "/var/www". And he will not see other users download folder.

And about maxdepth, if you have at most 4 levels of subfolders, yes, maxdepth = 0 or 4 is the same. But try with 1, 2 or 3 and you'll see the difference.
Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #19 on: 04-10-2006, 03:23:52 » Reply with quote

Ok, I've done some testing here and I am able to download files to other people's folders.  I can also download to the TF install directory.

Right now TF is installed in /home/user/public_html/

Users files go to /home/user/public_html/files/username

I created a test account and I am able to download files all the way back to /home/user/public_html/ which is where TF is installed.  I'm also able to put files in other people's folders, which is kind of nice actually.

Anyway, maybe this is the way you wanted it but I thought I'd let you know.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #20 on: 04-10-2006, 07:34:15 » Reply with quote

Oh, I understand why.
What you do is typing the path where you want to put your download. I'm at work, so i'll post a fix after going back home.
But I see where the problem is.
I just didn't thought about typing an "invalid" path yourself in the input box.
I will just have to get sure the path begins with "$cfg["path"].getOwner($torrent), so you can't go up.
Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #21 on: 04-10-2006, 09:01:48 » Reply with quote

That startpop should really hide all directories below the user folder.  Just for security sake.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #22 on: 04-10-2006, 13:17:31 » Reply with quote

I don't understand: it hides them. Well for me it does. Perhaps your $cfg["path"] is not your "root download folder"?
Because, if $cfg["path"] is your download root folder, then for your users, their download folder is /cfg/path/username.
And the dirTree functions displays only what's in /cfg/path/username.

[EDIT]: this fix was wrong, I'll made a new one [/EDIT]

I've tried adding a second user on my TF, and the startpop.php doesn't display /cfg/path/test (test being the... test user I've created). I can only see /cfg/path/my_real_user
« Last Edit: 04-11-2006, 01:10:21 by coldfire » Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #23 on: 04-10-2006, 13:40:30 » Reply with quote

I figured out what it is.  In admin I had the path to the downloads folder set all the way back to root on the server.  I changed it to be relative to the TF install and now it's great.

Sorry for the confusion.  I had no idea I could do it either way.
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #24 on: 04-10-2006, 14:36:33 » Reply with quote

I knew my hack was not so insecure! Wink
Well, your confusion made me figure a potential hole, which is now fixed!
Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #25 on: 04-10-2006, 14:38:16 » Reply with quote

Well, I'm glad I helped out in some way instead of just wasting your time.  Wink
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #26 on: 04-10-2006, 18:12:57 » Reply with quote

Alright, I hate to break this too you but I had to change my path settings back to what they were before.

TF gave me a green icon when setting that new path but none of my torrents will start.  I had to change it back to /home/account/public_html/downloads for torrents to start up again.  Once again, I'm stuck with everyone being able to see full path of the server.

I'd like for you to show me how to hard code it so no one sees below the downloads folder if you don't mind?

Maybe some day I'll be able to afford a dedicated box for torrents but right now I have to share the box with all my web hosting customers.  Wink
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #27 on: 04-11-2006, 01:20:29 » Reply with quote

Ok I think understand why this doesn't work for you.

In your download path (/home/account/public_html/downloads), "account" change regarding the user name?
So for your "user1" user on TF, his downloads should go to /home/user1/public_html/downloads, and if it's user2, then the downloads should go to /home/user2/public_html/downloads?

If I'm right, then edit startpop.php
Go line 241, and replace it with:
Code:
            <td colspan="3"><SELECT width="45" size="8" ONCHANGE="savepath.value= this.options[this.selectedIndex].value;"><?php $arDirTree = dirTree2 ('/home/'.getOwner($torrent).'/public_html/downloads/', $cfg["maxdepth"]) ; ?></SELECT></td>

If I'm still wrong, please explain me your webhosting path structure. Your hosted users downloads should go to /home/account/public_html/downloads/<username>/ with "account" not replaced by the user name, or should they go to /home/<user name>/public_html/downloads, like the fix a few lines up in THIS reply?

And be careful, the fix which was in my previous reply didn't work, if the input is disabled then its value is not passed to index.php when you click the start button
« Last Edit: 04-11-2006, 01:23:27 by coldfire » Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
coldfire
Jr. Member
**
Offline Offline

Posts: 64






View Profile Personal Message (Offline)
« Reply #28 on: 04-11-2006, 01:24:41 » Reply with quote

Well, I'm glad I helped out in some way instead of just wasting your time.  Wink

You're not wasting my time, because, I made this hack with only my home linux computer, where I'm alone on it, so I may have not figured things well enough, so your problem helps me improve my hack!
Report to moderator   Logged

Gentoo 2005-r1, TF 2.1 final + Specific Save Path, Multi-Upload and Page Refresh Countdown Timer hacks, 120GB dedicated to TF
JimmyTheGrunt
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 42





View Profile Email Personal Message (Offline)
« Reply #29 on: 04-11-2006, 09:30:36 » Reply with quote

 Grin

Code:
/home/account/public_html/downloads/<username>/

That right there would be correct!

On my box all web sites are located in /home/.

Let's say someone wants to host with me and their name is jim.  I will create an account on /home/jim/.

Anything jim would want on his web site will have to be placed in /home/jim/public_html/.  When he uses ftp to access things he goes right into /home/jim/ and all he can see is the public_html and other folders and files not accessable to people surfing the net.

I have done something similar with TF.  I installed it in /home/TF/public_html/.  So all my TF users are located at /home/TF/public_html/downloads/user1 and so forth.  Of course in admin my path has to go all the way back to /home/ and that's why when choosing a download path everyone can see all the way back to the /home/ directory.

Whew, I hope that made some kind of sense.  Wink
Report to moderator   Logged

Python 2.2.3
RHEL 3
PHP 5.0.5
MYSQL 4.1.21-standard
TF 2.1 B7
Pages: 1 [2] 3 4 Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP