PDA

View Full Version : [Filled] Custom site command, SITE GIVEACCESS


BobbyBonilla
11-02-2004, 01:27 PM
Hello,

I would like to implement the following custom site command:

site giveaccess <user>

The command is supposed to execute the following site command:

SITE CHANGE <user> VFSFILE ..\etc\private.vfs

Thanx a lot in advance for your help, Bobby.

jeza
11-02-2004, 02:27 PM
#include <stdio>

int main (int argc, char **argv)
{
if ( argc == 2 )
{
printf("Changing '%s' VFSFILE to '..\\etc\\private.vfs'\n",argv[1]);
printf("!change %s vfsfile ..\\etc\\private.vfs\n",argv[1]);
}

return 0;
}

BobbyBonilla
11-02-2004, 02:31 PM
and where do I add this?

jeza
11-02-2004, 02:50 PM
copy code to file and save as giveaccess.cpp

compile with borland c++ compiler
http://www.borland.com/products/downloads/download_cbuilder.html#


bcc32.exe -w- -O2 -Ipath.to\BCC55\Include -Lpath.to\BCC55\Lib -npath\to\where\u\wanna\this\exe -egiveaccess.exe path\to\giveaccess.cpp



in ioftpd.ini add command

givaaccess = exec path\to\giveaccess.exe


and
permission

giveacces = 1

jeza
11-02-2004, 02:55 PM
download the exe file here

http://www.ioftpd.com/scripts/script.php?id=148

neoxed
11-02-2004, 04:54 PM
You could have just used a simple batch file...

@ECHO OFF
ECHO Changing '%1' VFSFILE to '..\\etc\\private.vfs'
ECHO !change %1 vfsfile ..\\etc\\private.vfs
EXIT 0

BobbyBonilla, please post in the correct forum category; this is not a question specific to registered ioFTPD versions.

BobbyBonilla
11-03-2004, 04:49 AM
Sorry NeoXed for posting in the wrong section. Will try to do it right next time :>

Many thanks to both of u for your help.

Bye, Bobby.

dink-puller
11-05-2004, 02:30 AM
Originally posted by NeoXed
You could have just used a simple batch file...

ECHO !change %1 vfsfile ..\\etc\\private.vfs
EXIT 0



Is this how all ioFTPD commands can be executed in a batch file?
And...can the custom commands be added to a batch file too this same way, i.e. ECHO !<command> <params>, or just native ioftpd commands?

neoxed
11-05-2004, 03:18 AM
The !change command provides the same functionality for scripts, as the SITE CHANGE <target> <option> <parameters> command does for users.

dink-puller
06-21-2006, 07:48 AM
Can any site command custom or otherwise, be used in a batch file this way?