PDA

View Full Version : how to adduser with settings of a speicfic group


lxllol
08-20-2008, 04:29 PM
Hi, there.
I have more than three groups with different settings including ratio, speedlimit, and logins' number.
each time when i use "gadduser" to add a user to a specific group,
I also have to use "site change =group1 ratio 0", "site change =group1 speedlimit 500 0", etc to change these setting of the new user.

I'm wondering if there's a easier way to do that?
like just use the gadduser command, and all the other stuff could be excute automatically.

I've searched the forum, just figure a way mentioned by Mouton:


Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator


Join Date: Dec 2002
Posts: 2,025

--------------------------------------------------------------------------------

For those unpatient ones, a simple .itcl file trigerred on post SITE and that reacts to adduser and gadduser would do.
And maybe even a new SITE command to specify group settings.

SITE GRPCHANGE somegroup RATIO 0
SITE GRPCHANGE somegroup LOGINS 2 FTP
SITE GRPCHANGE somegroup TAGLINE I'm new in somegroup!

Those commands would write the settings in say ioFTPD\groups\Default.<GroupID>

And on SITE [G]ADDUSER ..., the itcl would read those settings for the right group, and apply them to the added user.

the link:https://oss.azurewebsites.net/forum/showthread.php?t=8095&highlight=group+user+default

however, i dont know how to do that specificly...


anyone who master this thing plz show me a specific way of doing this job.
thanks a lot in advance~~
:)

Yil
08-20-2008, 07:52 PM
I'm sorry to say, but there isn't a good way to do this. It's actually on my TODO list from when I implemented the /Default.User and /Default.Group commands but it got lost in the huge list...

First off, scan my Changelog for where I talk about /Default.User and /Default.Group. These allow you to set the default parameters for newly created users and groups respectively. The problem, as you noticed, is you can't specify different defaults for a new user based upon what group they are created in. My solution I thought is to support a new file "groups\GID.Defaults" which would actually be a userfile and not a groupfile but would act just like Default.User in the users directory would. I.e. it uses that file based on the group as the user template if it exists, else Default.User if it exists, else nothing.

The only problem is internally the module based system that allows you to add external userfile support doesn't have a way to pass the group information along when creating the user. However, given that neoxed hasn't updated nxShareDB to even work with the new userfile format in v6.5+ I may consider changing this interface since that's the only external module around anyway... I was hoping to think of a way to merge the group defaults afterwords but that would actually be annoying to do so I punted and stuck it on the TODO list...


Adding a flashfxp/ftprush/etc custom command is the easiest short term solution right now... Just have it prompt for a username and issue some change commands automatically for you.

You write "site change =group1 ratio 0". That's probably not a good thing to do since it will change everyone in the whole group to a ratio of 0 every time you execute it. You're probably better off just using "site change username ..." since you really only want to modify the new user anyway.

As a side note. 6.7.1 is looking stable, and it handles site gadduser differently now. In particular it make sure that the named group is the default/primary group for the user if you had specified default group(s) in /Default.User... At the minimum this should allow you to set the defaults properly for your most common group and then you'd only have to modify the settings for users in your 2 other groups...

lxllol
08-21-2008, 01:35 AM
thanks Yil.
I'm managing a leech site used by my friends, so there's only the differents in speedlimit but credits.
so the function i required is really needed for me.
the "gadduser" command is excuted automatically by linux machine, so flashfxp cant be helpful.

Hope we could use the io with this function just like glftpd as u said,
there are files in /users called "default.GROUP1", "default.GROUP2".... then it could be loaded when gadduser GROUP1 ....

:)

Yil
08-24-2008, 10:28 PM
Check out v6.8.0. Should do everything that you want :)

lxllol
08-29-2008, 02:50 PM
Yil, you're amazing! :D

works perfect on my Vista, cool beans,

thx man!