PDA

View Full Version : [REQ] Temporary Fix for ioShareDB Issues


peep
03-19-2004, 09:22 AM
Since ioShareDB apparently is discontinued (which btw is a pity, it was the start of something good) and since ioBv20 will be supporting such modules, we have to start working with what we've got. I'm putting a request for a couple of batchfiles that would make using ioShareDB a bit faster..


Now this is just to make adding users easier and faster..

gaddusers.bat
on: site grpadduser group1 user1 password1 ident@ip

exec site grpadd group1
if "500 group1: Group already exists."
goto adduser
if "200 grpadd Command successful."
goto adduser

:adduser
exec site adduser user1 password1 ident@ip
if "200 adduser Command successful."
goto chgrp

:chgrp
exec site chgrp user1 group1
if "200- User 'user1' has been successfully added to 'group1' group.
200 chgrp Command successful."
goto change

:change
exec site change user1 ratio 3
exec site change user1 logins 2


could when finished also echo all what's been done..

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


addmember.bat (for affils)

Using ioShareDB also makes life quite messy for the affils. When a groupadmin adds a new member, the member first of all is added with leech and secondly is added to group 'null', which then would have to be changed by an op.

Anyone wanna suggest how such an algoritm would look like? Or perhaps someone allready has made such a .bat/.exe? *bump*

:rolleyes:

Mouton
03-19-2004, 11:32 AM
just batch files that fixes what ioSharedDb doesn't do would be enough...
ie on adduser, add the user to the current group + change it's ratio to x.
on gadduser, add the user to the specified group + change it's ratio to x.

We can't use FTP_Custom_commands since this would be execute before the actual g/adduser command... So we need to use the post SITE event...

Using a batch file, the ratio and number of logins that ioSharedDB doesn't set can be fixed. The problem is that I don't know a way to change the group using !commands in an external script...
An itcl would probably do a better job.

Here's what i use (note: the !chgrp doesn't work):
@echo off
echo !buffer off

IF %2==GADDUSER GOTO GADDUSER
IF %2==gadduser GOTO GADDUSER
IF %2==ADDUSER GOTO ADDUSER
IF %2==adduser GOTO ADDUSER
GOTO END

:GADDUSER
set adduser=%4
GOTO CHANGE

:ADDUSER
set adduser=%3
echo !chgrp %adduser% %group%
echo 200-User '%adduser%' was added to group '%group%'
GOTO CHANGE

:CHANGE
set addratio=3
set addlogins=2

echo !change %adduser% logins %addlogins% FTP
echo 200-User '%adduser%' was given %addlogins% FTP login slots.
echo !change %adduser% ratio %addratio% section 0
echo 200-User '%adduser%' ratio was changed to 1:%addratio% in section 0.

:END
echo !buffer on

peep
03-19-2004, 01:09 PM
Ok great! Anyone wanna fill in on the chgrp issue? d1, you around and might be able to help?