XFileSharing Pro - How to limit bandwidth against premium user account?

Message
Author
mac1111
Posts: 7
Joined: Sep 18, 2012 3:10 pm

How to limit bandwidth against premium user account?

#1 Postby mac1111 » Sep 28, 2012 12:39 pm

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.

admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

#2 Postby admin » Sep 28, 2012 5:06 pm

indel_dl.pm line 200:

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});

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 $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});


mac1111
Posts: 7
Joined: Sep 18, 2012 3:10 pm

#3 Postby mac1111 » Sep 28, 2012 5:51 pm

admin wrote:indel_dl.pm line 200:

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});

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 $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});

Thanks, I do it, now could limit bandwidth against with premium username.

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.

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

Re: How to limit bandwidth against premium user account?

#4 Postby afdah » Sep 29, 2012 12:17 am

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.
i think for anonymous users, we limit by 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?

leecher
Posts: 22
Joined: Nov 01, 2011 1:37 am

#5 Postby leecher » Oct 15, 2012 11:20 am

admin wrote:indel_dl.pm line 200:

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});

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 $cond AND created > NOW()-INTERVAL ? DAY",$c->{bw_limit_days});

I'm did it like this but nor working for me. To try this option i'm logged in
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

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#6 Postby afdah » Oct 19, 2012 10:02 pm

download the latest XFS in your client area. this bug, is now fixed.

ufkabakan
Posts: 332
Joined: Apr 13, 2011 9:37 pm

#7 Postby ufkabakan » Oct 21, 2012 9:57 am

afdah wrote:download the latest XFS in your client area. this bug, is now fixed.
When fixed?

leecher
Posts: 22
Joined: Nov 01, 2011 1:37 am

#8 Postby leecher » Oct 29, 2012 10:30 am

Can some one help with this problem ?

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#9 Postby afdah » Oct 29, 2012 10:52 am

what problem?
just download the latest XFS in your client error. this is fixed already.

leecher
Posts: 22
Joined: Nov 01, 2011 1:37 am

#10 Postby leecher » Oct 29, 2012 11:08 am

afdah wrote:what problem?
just download the latest XFS in your client error. this is fixed already.
I saw this "XFileSharing Pro Latest Version: 2.0 (2012-04-13)". When it was fixed ?

Edited : I'm downloaded latest version and repplace files but this option dont working. Dont know WTF is this.

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#11 Postby afdah » Oct 29, 2012 1:10 pm

XFileSharing Pro Latest Version: 2.0 (2012-04-13)
if you noticed the changed files date insize the zip, some are last modified in october.

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