XFileSharing Pro only limit bandwidth against with ip, this just apply to anonymous and registered.
I found premium user could change new ip or use proxy to reborn full quota when they use up current quota.
It same as void if can't limit bandwidth against with premium user account. I wanna know how to limit with usename, not just ip.
XFileSharing Pro - How to limit bandwidth against premium user account?
indel_dl.pm line 200:
replace with
Code: Select all
#my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')";
my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE ip=INET_ATON(?) AND created > NOW()-INTERVAL ? DAY",$ses->getIP,$c->{bw_limit_days});
Code: Select all
my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')";
my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});
Thanks, I do it, now could limit bandwidth against with premium username.admin wrote:indel_dl.pm line 200:
replace withCode: Select all
#my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')"; my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE ip=INET_ATON(?) AND created > NOW()-INTERVAL ? DAY",$ses->getIP,$c->{bw_limit_days});
Code: Select all
my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')"; my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});
But I found another bug: Now display "You have reached the download-limit" when change new ip try to open file link, this is rgiht. But "Traffic available" still display full bandwidth quota in "My Account".
How to display correct data and keep limit bandwidth against with premium username.
Re: How to limit bandwidth against premium user account?
i think for anonymous users, we limit by ip.mac1111 wrote:XFileSharing Pro only limit bandwidth against with ip, this just apply to anonymous and registered.
I found premium user could change new ip or use proxy to reborn full quota when they use up current quota.
It same as void if can't limit bandwidth against with premium user account. I wanna know how to limit with usename, not just ip.
for registered, we limit by ip and username. because registered users can always create multi accounts to bypass limitations.
for premium, we limit by username.
what do you think?
I'm did it like this but nor working for me. To try this option i'm logged inadmin wrote:indel_dl.pm line 200:
replace withCode: Select all
#my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')"; my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE ip=INET_ATON(?) AND created > NOW()-INTERVAL ? DAY",$ses->getIP,$c->{bw_limit_days});
Code: Select all
my $cond = $ses->getUser ? "usr_id=".$ses->getUserId : "ip=INET_ATON('".$ses->getIP."')"; my $bw = $db->SelectOne("SELECT SUM(size) FROM IP2Files WHERE $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});
from one ip and download the file, traffic decreased. Then i'm logged in with this account details from another ip,go to my account and check available traffic and saw : my available traffic encreased ( i mean downloaded file from another ip is not count and dont show at new ip.
My server :
OS: FreeBSD 8.x 64bit
nginx + apache
if you noticed the changed files date insize the zip, some are last modified in october.XFileSharing Pro Latest Version: 2.0 (2012-04-13)
the files inside the archive has been modified many times since 2012-04-13
it's just that no announcement was made.
i don't know about your client area, but mine got the bug fixed. both files are last modified on 3rd october.
index.cgi
index_dl.pm