Well it came that i wanted to allow
other users to use my TF box, but i DIDNT want them to
see what other users were downloading.
So i
hacked the code alittle.
This will make NORMAL
users only able to see their OWN torrents, they CANT see
what other users are downloading. Admins can still see
other files.
This wasnt done to a Vanilla
install, this is the "torrentflux_2.1+" install pack
from one of thee multihacks things.
Heres the
changes for mine:
Line 2916
Find:
if (sizeof($arListTorrent) > 0)
Replace with:
if ( (sizeof($arListTorrent) > 0) && (IsAdmin() == true) )
Thats
the only change.
In a vanilla install(Which i havnt
tested) the line is 2520, same change as above should be
made.
I was thinking of making it so as the users
can see the download percentage/speed/status just
couldnt see the torrent names, And i may do that later,
this was just a quick hack to add the fuction in so i
could let others onto it
ASAP.
:::EDIT:::
Part 2:
I Forgot about
dir.php!
Line: About 34
Find
$dir = stripslashes(urldecode(getRequestVar('dir')));
And place this after it:
if (IsAdmin() == false){
$cfg['path'] = $cfg['path'].$cfg['user'].'/';
if( substr($dir,0,strlen($cfg['user'])) == $cfg['user'] ){
$dir = substr($dir,strlen($cfg['user']));
}
}
it now looks like this:
$dir = stripslashes(urldecode(getRequestVar('dir')));
if (IsAdmin() == false){
$cfg['path'] = $cfg['path'].$cfg['user'].'/';
if( substr($dir,0,strlen($cfg['user'])) == $cfg['user'] ){
$dir = substr($dir,strlen($cfg['user']));
}
}
I
think i've covered everything thing now
::::Edit2::::
'doh.. noticed another
file.
History.php:
Line: About 55
Find this:
$sql = "SELECT user_id, file, time FROM tf_log WHERE action=".$db->qstr($cfg["constants"]["url_upload"])." OR action=".$db->qstr($cfg["constants"]["file_upload"])." ORDER BY time desc";
Replace with this:
if (IsAdmin() == true){
$sql = "SELECT user_id, file, time FROM tf_log WHERE action=".$db->qstr($cfg["constants"]["url_upload"])." OR action=".$db->qstr($cfg["constants"]["file_upload"])." ORDER BY time desc";
} else {
$sql = "SELECT user_id, file, time FROM tf_log WHERE user_id='".$cfg['user']."' AND ( action=".$db->qstr($cfg["constants"]["url_upload"])." OR action=".$db->qstr($cfg["constants"]["file_upload"])." ) ORDER BY time desc";
}
Hope
its of use to someone
NOTE: can someone else
please tell me if download files/tar directory still
works? Its failing on my install, and i cant see any
reason for it to.
DD32
EDIT:
The
Codebase for this was this:
http://www.torrentflux.com/forum/index.php/topic,1265.0.html