View Single Post
Old 10-12-2011, 01:45 PM  
Too much time...
Join Date: May 2005
Posts: 1,194

Ditto. I know nothing about ioGive/Take, so no help there, but I SRH99 is exactly right about pointing you to the [Sections] section of the .ini file.

If I remember correctly there are several examples in the .ini file you should take a look at first to get an idea of what you can do. I think the answer you are looking for can be handled by setting the credit and share sections appropriately.

Currently ioFTPD assumes that you'll either be just using 1 default section and the user will have a global ratio, or you'll be defining sections in the .ini (up to 25) and you can set things independently for each. Every user supports independent ratio/credits/stats for each section you define. So if you use something like:

REQUESTS = 1 0 0 /REQ/*
Default = 0 0 0 *
I'm pretty sure the above will help you do what you want. Basically it says that section #0 of each userfile should hold the credits (share section = 0) and the stats (day, week, month, total files/bytes up/down) but that the ratio to apply for uploaded files should be looked up in section #0 for everything but the REQUESTS section which should be looked up in the user's section #1 ratio. This means you'll need to update the userfiles appropriately since you probably only set section #0 correctly.

Use something like this:
site change ":0>1" ratio 5 1
What that says is match all the users who have a ratio greater than 1 in section #0 (i.e. people without leech) and then set the ratio to 5 for section #1. Now everybody who doesn't have leech will have a 1:5 ratio for REQUESTS.

That solves the problem for all existing users, but you'll need to change the default settings for newly created users as well. You do that by:
site change /Default.User ratio 5 1
and if you have multiple groups defined that have customized settings. I..e you've used 'site change /Default=SiteOps' at some point to change the settings for new users created into the SiteOps group you'll want to also change the default ratio for them as well. Well, not really necessary with the SiteOps who would have leech anyay, but you get the idea. You can tell if you have customized groups via 'site groups' if you look at the custom column to see if it says Yes. That means users CREATED into that group will use those settings instead of the Default.User ones so you may have to update them.

NOTE: If you do the common "site change bob ratio 0" to give a user leech on your server you WILL NOT be giving him leech in the REQUESTS dir. You'll have to also do "site change bob ratio 0 1" as well. I really should add a simple way to set all ratios in one command, but right now you're kind of stuck with that for the moment. I'm adding a new TODO item right now In practice this isn't a huge problem because if you setup group defaults for users who should have leech and use site gadduser you won't be changing ratios anyway.

That's it. However, since you are defining sections anyway you might as well go ahead and use something like this instead:

MP3 = 0 3 0 /MP3/*
MOVIES = 0 2 0 /MOVIES/*
REQUESTS = 1 1 0 /REQ/*
Default = 0 0 0 *
As far as the user is concerned this works the same as the above, ratio is controlled by section 0, except for the REQUESTS section, but when they enter the MP3/MOVIES dir they will show up in the appropriate section whenever a transfer/listing is done. That means nothing to them until they go and do a 'site myinfo' or you use 'site uinfo' on them. At that point you will get a breakdown of uploaded/downloaded files for EACH SECTION for the day, week, month, and total. Kind of useful to figure out which sections are popular on your server and who uploads/downloads what.

For the moment I suggest using less than 10 sections because not all scripts handle the newer 25 limit though...
Yil is offline   Reply With Quote