ServuEvent.dll is a simple dll that allows servu to run just about any exe, cmd or bat after a serv-u event has arrived. Every event has can be used with parameters and is given in ServuEven.ini: Before you use this some thing to be aware of: This dll does not work if you have your data stored in the registry instead of in the ini file (Servu 3.x and up). It works for servu 3.x, 4.x and 5.x. There is a smaller version available specially for Serv-U 2.x ServuEvent.ini settings - check in your helpfile under "Extending Serv-U" how it works. ServuEvent.ini needs to be where you placed ServuEvent.dll. If you havent placed it there then it will try to find this file in the dir where ServuDaemon.exe (or Serv-U32.exe for version 2.x) is. You can cut and paste the piece below to make your own ServuEvent.ini , then fill in the events as you use them. Uncomment a line by removing the ; in front of it. Servuevent.ini should be a part of this distribution. To execute a .bat or a .cmd file (yes there is a difference!) use: c:\windows\system32\cmd.exe /c blahblah.cmd or c:\windows\system32\cmd.exe /c blahblah.bat Commands can also give a reply back via the console output. This console can be piped back to the client that logged on. Examples of a console program with console piping: DownloadAllowedCheck.c could be: #include #include #include int main(int argc,char *argv[]) { time_t t; struct tm *tm; if (argc==1) return -1; printf("The server has been running for %ServerDays\n"); if (!stricmp(argv[2],"Administrator")){ printf("Only the Administrator is allowed to download anything\n"); return -1; //<0 command fails } time(&t); tm=localtime(&t); if (tm.wday==0 || tm_wday==6){ printf("Download on Sundat and Saturday is not allowed\n"); return -1; } return 0; //return 0 because we want servu to handle this further on } ---------------------------------------------------------------------- To make life easier ServuEvent supports a big bundle of cookies. Do not mistake these cookies with the Serv-u variables itself. These servuevent cookies can be used when calling external programs or cheking permissions using ServuEvent.dll. They are valid in the [Events] the [Pre] , the [Post] and the [Permissions] section The User cookies are: %[Dns] = the dns name of the user, or the ip address %[Password] = the userpassword, only available when the user is anonymous %[Command] = a string describing what the user is doing (last command) %[Cwd] = the current working directory the user is in %[Dir] = the complete path of the dir being created/deleted %[DirName] = the name of the dir being created/deleted %[File] = the complete filepath being uploaded/deleted/renamed %[FileName] = the name of the file being uploaded/deleted/renamed %[RenameFile] = the complete filepath being uploaded/deleted/renamed %[RenameFileName] = the name of the file being uploaded/deleted/renamed %[LoginTime] = the date/time when the user was logged in in mm-dd-yyyy hh:mm:ss %[UserCount] = the count of all the logged in users %[Event] = the event number, see the servu help file for its reference %[SubEvent] = the sub event number, see the servu help file for its reference %[Id] = the unique connection id for the user %[Name] = the name of the user that is logged in %[User] = the name of the user that is logged in %[UserName] = the name of the user that is logged in %[Ip] = the ip number of the user that is logged in %[LocalIp] = the ip number of the server %[Duration] = the duration of the up/download in msec %[Size] = the size of the up/download file %[Aux1] = this can differ, see the table below, see also the servu help file %[Aux2] = this can differ, see the table below, see also the servu help file %[Speed] = the speed in bytes/milliseconds (which is almost KBytes/s) %[DomainPort] = the port of the domain that the user is connected to (Only for Serv-u 4.1.0.3 and up) %[DomainId] = the ID of the domain the user is connected to (see in the ServuDaemon.ini) (Only for Serv-u 4.1.0.3 and up) %[BDayUp] = amount of bytes upped during this day %[BDayDn] = amount of bytes downed during this day %[BMnUp] = amount of bytes upped during this month %[BMnDn] = amount of bytes downed during this month %[BWkUp] = amount of bytes upped during this week %[BWkDn] = amount of bytes downed during this week %[BAlUp] = amount of bytes upped totally %[BAlDn] = amount of bytes downed totally %[BSessionUP] = amount of bytes downed in this login session %[BSessionDN] = amount of bytes downed in this login session %[KBDayUp] = amount of Kbytes upped during this day %[KBDayDn] = amount of Kbytes downed during this day %[KBMnUp] = amount of Kbytes upped during this month %[KBMnDn] = amount of Kbytes downed during this month %[KBWkUp] = amount of Kbytes upped during this week %[KBWkDn] = amount of Kbytes downed during this week %[KBAlUp] = amount of Kbytes upped totally %[KBAlDn] = amount of Kbytes downed totally %[KSessionUP] = amount of Kbytes downed in this login session %[KSessionDN] = amount of Kbytes downed in this login session %[MBDayUp] = amount of Mbytes upped during this day %[MBDayDn] = amount of Mbytes downed during this day %[MBMnUp] = amount of Mbytes upped during this month %[MBMnDn] = amount of Mbytes downed during this month %[MBWkUp] = amount of Mbytes upped during this week %[MBWkDn] = amount of Mbytes downed during this week %[MBAlUp] = amount of Mbytes upped totally %[MBAlDn] = amount of Mbytes downed totally %[MSessionUp] = amount of Mbytes downed in this login session %[MSessionDn] = amount of Mbytes downed in this login session %[GBDayUp] = amount of Gbytes upped during this day %[GBDayDn] = amount of Gbytes downed during this day %[GBMnUp] = amount of Gbytes upped during this month %[GBMnDn] = amount of Gbytes downed during this month %[GBWkUp] = amount of Gbytes upped during this week %[GBWkDn] = amount of Gbytes downed during this week %[GBAlUp] = amount of Gbytes upped totally %[GBAlDn] = amount of Gbytes downed totally %[GSessionUp] = amount of Gbytes downed in this login session %[GSessionDn] = amount of Gbytes downed in this login session %[DayUp] = amount of bytes/Kbytes/MBytes/GBytes upped during this day %[DayDn] = amount of bytes/Kbytes/MBytes/GBytes downed during this day %[MnUp] = amount of bytes/Kbytes/MBytes/GBytes upped during this month %[MnDn] = amount of bytes/Kbytes/MBytes/GBytes downed during this month %[WkUp] = amount of bytes/Kbytes/MBytes/GBytes upped during this week %[WkDn] = amount of bytes/Kbytes/MBytes/GBytes downed during this week %[AlUp] = amount of bytes/Kbytes/MBytes/GBytes upped totally %[AlDn] = amount of bytes/Kbytes/MBytes/GBytes downed totally %[SessionUp] = amount of bytes/Kbytes/MBytes/GBytes downed in this login session %[SessionDn] = amount of bytes/Kbytes/MBytes/GBytes downed in this login session %[FilesDayUp] = amount of files upped during this day %[FilesDayDn] = amount of files downed during this day %[FilesMnUp] = amount of files upped during this month %[FilesMnDn] = amount of files downed during this month %[FilesWkUp] = amount of files upped during this week %[FilesWkDn] = amount of files downed during this week %[FilesAlUp] = amount of files upped totally %[FilesAlDn] = amount of files downed totally %[FilesSessionUp] = amount of files upped totally %[FilesSessionDn] = amount of files downed totally %[CountDn] = amount of files currently being download by this user under this username and various sessions on this domain %[CountUp] = amount of files currently being uploaded by this user under this username and various sessions on this domain %[ArgsAll] = the changed command line with some space adjustments, this is the complete commandline when the command is NOT recognised as a Pre command, otherwise it is the arguments after the Pre command. %[Arg0] .. %[Argx] = with x any number, the arguments for the command. These are the arguments derived from the above cookie. So in case of the pre command not being recognized these are coming from the raw commandline. %[CountUserDn] = number of downloads happening by this user on any ip at this moment (per domain) %[CountUserUp] = number of uploads happening by this user on any ip at this moment (per domain) %[CountIpDn] = number of downloads happening by this ip on any user at this moment (per domain) %[CountIpUp] = number of uploads happening by this ip on any user at this moment (per domain) %[CountUser] = number of connections under this username at this moment (per domain) %[CountIp] = number of connections under this ip at this moment (per domain) The System cookies are: %[Date] = the current date on the server in with format YYYY-MM-DD %[Time] = the current time on the server in with format HH:MM:SS %[TotalSpeed] = the total speed of the server (up+down) %[TotalSpeedDown] = the sum of all the download speeds together %[TotalSpeedUp] = the sum of all the upload speeds together %[TotalUsersIdle] = the number of users being idle %[TotalUsersDown] = the number of users downloading %[TotalUsersUp] = the number of users uploading %[TotalUsers] = The number of users connected %[Raw] = the raw command performed last, e.g. STOR blah.txt %[PathServu] = full path to ServuDaemon.ini %[PathServuEvent] = full path to ServuEvent.ini %[PathServuDir] = full directory path where ServuDaemon.ini is placed %[PathServuEventDir]= full dir path where ServuEvent.ini is placed User cookies do not work for events that have nothing to do with users (EveryDay, EveryHour, EveryMinute, EverySecond, Started, Stopped). Apart from this all the settings for a user are stored in the ServuDaemon.ini. Settings such as: Note1=blah@blah.com HomeDir=.... etc... Now these settings will be available as cookies as well. So the examples of above are: %[Note1] %[HomeDir] ... These are user cookies. Please check the appropriate ini file for which ones you can use. Some usefull ones are: %[Group] %[HomeDir] %[Maintenance] %[Note1] %[Access1] A special word of warning for %[Group] usage. If you use it with multiple groups it will be taken from the ini file like (example): Group=TestGroup|AdminGroup . Now if you use it in a dos command then you MUST realize that the | character has a special meaning (it is the pipe character). Thus do place double quotes around it. So: ChgDir=c:\windows\system32\cmd.exe /c echo "%[GROUP]" >>c:\servu.log is correct where ChgDir=c:\windows\system32\cmd.exe /c echo %[GROUP] >>c:\servu.log is not correct. All cookies can be used with length options. That goes as follows: %minwidth.maxwidth[cookie] minwidth is the minimal number of character to be shown, this number can be <0 or >0 or even absent. if it is <0 then it will be right aligned, otherwise leftaligned this may or may not be followed by a period maxwidth is the maximal number of characters to be shown. Examples: Suppose the %[File] cookie has value C:\FTP\DIR\FILE.TXT %[File] gives "C:\FTP\DIR\FILE.TXT" %10[File] gives "C:\FTP\DIR\FILE.TXT" %-10[File] gives "C:\FTP\DIR\FILE.TXT" %25[File] gives "C:\FTP\DIR\FILE.TXT " %-25[File] gives " C:\FTP\DIR\FILE.TXT" %25.5[File] gives "C:\FT " %-25.5[File] gives " C:\FT" %.5[File] gives "C:\FT" %-.5[File] gives "%-.5[FILE]" this is an incorrect cookie %XY[File] gives "%XY[FILE]" this is not recognized as correct Any unrecognized cookie gets directly printed as shown in the abovev example. Now you can also use userdependant events, yet you MUST be aware which servu version you run for this. For that you have to place the events in the Users.ini file. The syntax is exactly as you would find in ServuDaemon.ini file. User events are stored in the Users.ini file. Also you can have group events, they need to be in Groups.ini. Say we have user JOHN [USER=JOHN|1] Password=JOHNSPASS HomeDir=c:\ftp TimeOut=45 Access1=c:\ftp,RWAMCDLEP So now in Users.ini we make: [USER=JOHN|1] EndUp=HIDE|2|c:\windows\system32\cmd.exe /c echo %[USER] uploaded %[FILE] >>c:\serv-u\logs\%[USER].log The events are triggered in the following order: -All user events are triggered first one by one but they do not wait for each other, if there are user events in Users.ini then the group and system events will not be used for that user at that time. -All group events are triggered in order of the groups that the user is in from Groups.ini, one by one but they also do not wait for each other. If there are Group events for that user, the the system events for that user will not be triggered. -System events from ServuEvent.ini. All events of the same type get triggered. So if you use for example multiple EndUp= System events then they will all be triggered. ...etc... The events that you can use for a single user or a group are (See ServuEvent.ini): Login= Close= BouncedIP= TooMany= ;I discovered that Serv-U 6 never triggers this event, so you can not use it. WrongPass= ;I discovered that Serv-U 6 never triggers this event, so you can not use it. TimeOut= Login= StartUp= EndUp= StartDown= EndDown= AbortUp= AbortDown= Rename= DelFile= DelDir= ChgDir= MakeDir= BadPass= ;This event I had to create myself due to the point that not all Serv-U versions properly trigger WrongPass. ;It gets triggered as soon as someone types a bad Password during login All these events work as documented in the ini file. So the arguments for example of IPName will not be triggered ever for a user since the username is normally not given yet at that moment. For Serv-u 3.x/4.x/5.x earlier versions be carefull here is NO domain info available from the internal structures. I think from below version 4.1.0.3 on there is so it will in such a case assume that the domain=1. I do my best to find out which domain is being used for the older versions and can determine the unique domainnumber as long as the username is unique. In 4.1.0.3 and above there is a domain so the ServuDaemon.ini can look like this: [USER=JOHN|1] Password=JOHNSPASS HomeDir=c:\ftp TimeOut=45 Access1=c:\ftp,RWAMCDLEP Group=Admin|Normal ... So now in Users.ini we make: [USER=JOHN|1] EndUp=HIDE|2|c:\windows\system32\cmd.exe /c echo %[User] uploaded %[File] >>c:\serv-u\logs\%[User].log ....etc... You can have in Groups.ini: [Group=Admin|1] EndUp=HIDE|2|cmd.exe /c echo %[User] got an Admin group upload EndUp=HIDE|2|speak.exe %[User] uploaded a file [Group=Normal|1] EndUp=HIDE|2|cmd.exe /c echo %[User] got a Normal group upload Now if your users are stored in the registry this can be confusing, I am not finished yet with full registry and odbc support. This is on my todo list so it will come as my time allows me to add it. In this current version only the HomeDir, Maintenance and Group entries of a user setting from ServuDaemon.ini is being used/ If a user has no event then the event in ServuEvent.ini will be executed. So the userevent overrules the groupevent which in its turn overrules the global system events from ServuEvent.ini Now how to use this DLL in servu? Simple grab your SevuDaemon.ini (servu 3.x and up) or Serv-U.ini (servu 2.5) and add the following. [EXTERNAL] EventHookDLL1=ServuEvent.dll Another small example of event use, log data of uploads to a file: EndUp=HIDE|2|c:\windows\system32\cmd.exe /c echo user %[NAME]/%[PASSWORD] from %[DNS] is on current directory %[CWD] uploaded "%[FILE]" >>c:\servu.log Or an event that logs everything on change of dir ChgDir=HIDE|2|c:\windows\system32\cmd.exe /c echo "USERCOUNT=%[USERCOUNT] GROUP="%[GROUP]" DNS=%[DNS] PASSWORD=%[PASSWORD] COMMAND=%[COMMAND] CWD=%[CWD] DIR=%[DIR] DIRNAME=%[DIRNAME] FILE=%[FILE] FILENAME=%[FILENAME] RENAMEFILE=%[RENAMEFILE] RENAMEFILENAME=%[RENAMEFILENAME] LOGINTIME=%[LOGINTIME] RAW=%[RAW] EVENT=%[EVENT] SUBEVENT=%[SUBEVENT] ID=%[ID] NAME=%[NAME] IP=%[IP] LOCALIP=%[LOCALIP] DURATION=%[DURATION] SIZE=%[SIZE] AUX1=%[AUX1] AUX2=%[AUX2] SPEED=%[SPEED] DOMAINPORT=%[DOMAINPORT] DOMAINID=%[DOMAINID] DATE=%[DATE] TIME=%[TIME]" >>c:\servu.log Implemented commands SITE WHO - show what users are doing The following commands ONLY work for the superuser/System administrator. They are experimental for now with it you can remotely add and remove users and change settings so be carefull what you do. This is not for beginners, you have to have a good understanding of the ini file. SITE READINI - show the whole ini file SITE READINI sectionname - show part of the ini file. e.g. SITE READINI Domain1 SITE READINI sectionname keyname - show part of the ini file specifically the blah=. e.g. SITE READINI USER=TestUser|1 Password SITE WRITEINI sectionname keyname=value - change part of the ini file. e.g. SITE WRITEINI USER=TestUser|1 Password NewPassword SITE DELINI sectionname - delete a whole part of the ini. E.g. SITE DELINI USER=testUser|1 SITE DELINI sectionname keyname - delete a part of the ini, specially the blah=. e.g. SITE DELINI Domain1 User1 SITE REHASH - reload the [Pre] and [Events] part of ServuEvent.ini SITE USERS - show a list of users SITE DOMAINS - show a list of domains SITE USERS domain - show a list of users from a domain SITE ADDUSER username domain password - add a user to the ini. check your ServuDaemon.ini or Serv-u.ini for that. SITE ADDUSER username password - add a user to the ini. SITE DELUSER username domain - delete the user. Only the system user is allowed to do that. Be aware it may take 15 seconds for servu to really delete the user. SITE CHPASS username domain password - change the password of the user SITE XWHO - get extended info about who is logged in SITE REBOOT - Shuts down the system and then restarts the system. SITE SHUTDOWN - Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped. If the system supports the power-off feature, the power is also turned off. SITE POWEROFF - Shuts down the system and turns off the power. The system must support the power-off feature Notes of importance: In order to use this event you have to store the data in the ini and not in the registry. In order to use site chpass you cant use encrypted passwords. Be aware of redirecting a line like this: c:\windows\system32\cmd.exe /c test 2>>c:\test.log this will not redirect, use a space between the 2 and the >> For your convenience I have repeated the internal Servu cookies, those can be used in the message files for servu. That means that they can also be used in the message files in Servu. You can also find this information in the servu help file. Time/date: %Time - displays the current time on your PC %Date - displays the current date on your PC Server statistics: %ServerDays - displays the number of days the server has been running %ServerHours - displays the number of hours the server has been running %ServerMins - displays the number of minutes the server has been up %ServerSecs - displays the number of seconds the server has been up %ServerKbUp - displays the no. Kbytes uploaded to the server since server start %ServerKbDown - displays the no. Kb downloaded from the server since server start %ServerFilesUp - displays the no. of files uploaded to the server since server start %ServerFilesDown - displays the no. of files downloaded from the server since server start %LoggedInAll - displays total no. of logged in users since server start %ServerAvg - displays the average server throughput since server start %ServerKBps - displays current server bandwidth use Server settings: %MaxUsers - displays the maximum no. of users, as set in 'Setup - Server' %MaxAnonymous - the maximum no. of anonymous users, as set in 'Setup - Server' User info: %Name - displays the user's login name %IP - displays the user's IP number or name if available %Dir - displays the user's current directory %Disk - displays the user's current disk drive %DFree - displays the amount of free space on the user's current disk in Kb %FUp - displays the number of files uploaded by the current user %FDown - displays the number of files downloaded %FTot - displays the total number of files transferred %BUp - displays the number of Kbytes uploaded by the user %BDown - displays the number of Kbytes downloaded by the user %BTot - displays the total number of Kbytes transferred %TConM - displays the total connect time in minutes %TConS - displays the connect time in seconds - to be used with '%tconm' %RatioUp - displays the 'upload' ratio part for UL/DL ratios %RatioDown - displays the 'download' ratio part for UL/DL ratios %RatioCredit - displays the current download credit for UL/DL ratios (Kb or 'files') %QuotaUsed - displays how much disk quota is used in Kb %QuotaLeft - displays how much disk quota is left in Kb %QuotaMax - displays the maximum amount of disk space that can be used in Kb Number of users: %UNow - displays the current number of Serv-U users connected %UAll - displays the number of users since the server was started %U24h - displays the number of users in the last 24 hours %UAnonAll - all currently logged in anonymous users %UAnonThisIP - all anonymous users logged into this IP home %UNonAnonAll - all non-anonymous users currently logged in %UNonAnonThisIP - all non-anonymous users logged into this IP home %UThisName - all current users with the current user name logged into this IP The file upload and download message directives are for the current session only (i.e. they do not show the aggregate over multiple sessions). The '%ServerDays', '%ServerHours', '%ServerMins', and '%ServerSecs' directives are meant for use together. The number of hours is what's left after the number of days is subtracted, and the same goes for the number of minutes and seconds. Thanks to and inspiration from: dshadow, various other unmentioned peole that had some nice addon ideas. Version: 0.1.0 Only support for EndUp 0.2.0 Newer version supports more events 0.3.0 many events added 0.4.0 EveryDay event added, reduced the dll drastically in size no longer uses default libs but now msvcrt.dll 0.5.0 SITE hook added 0.6.0 GUILDFTPD seems to have a different idea about a filepath then servu. So now all / is converted to \ in the final commandline that is being executed. 1.0.0 SITE WHO is implemented. Now it is no longer needed to restart servu when you change ServuEvent.ini contents. The settings are fetched when needed. This is not as fast but the delay is minor and the flexibility increases. For guildftp users: you can use another SITE WHO command and still keep using the standard SITE WHO from guildftpd. 1.0.1 Fixed a bug where no command ran at all (except in debug mode). 1.0.2 Fixed: when servu started as service ini file couldnt be found Changed: Preparation of ClientCheckDLL, will be implemented later. 1.0.3 Changed: the whole cookie system is turned upside down. Other cookie names and more cookie parameters. Fixed: now only dir and filenames have / converted to \ (for guildftpd, since that is the only one that is doing this strange). 1.0.4 Added: ability to show the ini file. 1.0.5 Changed: Some people reported a crash so I increased the internal buffers and put some more checking code in. Changed: SITE WHO reply is different Added: SITE RULES Changed: disable the hook commands Removed: BouncedIP catching for site who Removed: Group of user in site who (since it only works under servu 2.5 and not under guild or servu 3.x or up), it may come back when I have the time for it. I would still need to figure out how the domain and multiple users work for Servu 4.x 1.0.6 I have finally found the way to update the users when looking on the serv-u site. Thus now it is possible to do that. Note that this option is not available under GuildFTPD. Changed: SITE WHO slightly altered Added: SITE DELUSER username Added: %[DOMAINPORT] and %[DOMAINIP] cookies 1.0.7 Added: SITE DOMAINS Added: SITE USERS DOMAIN 1.0.8 Updated: The help piece of this file Added+changed: Some cookies Added:EveryHour, EveryHour, EveryMin 1.0.9 Fixed: site who could cause a crash Fixed: Close event didnt work properly thus errors could be the result Changed: the Close event was called after the user was removed from the internal list, that made that the user data was not visible. Added: %[USER] and %[USERNAME] as synonyms for %[NAME] 1.0.10 Added: Started and Stopped events. 1.0.11 Added: Support for alternate Servu ini files. 1.0.12 Added: User speeds are added together for actual server speed Added: Progress is now shown as well in site who Added: %[TOTALUSERSIDLE], %[TOTALUSERSUP], %[TOTALUSERDOWN], %[TOTALSPEEDUP], %[TOTALSPEEDDOWN] Added: EverySecond event added but in such a way that you can disable it by commenting it out in the ini file (less cpu use then). Changed: on a day switch EveryDay,EveryHour, EveryMinute,EverySecond get triggered, on an hour switch EveryHour,EveryMinute,EverySecond etc.. 1.0.13 Changed: Size is now (if you have servu 4.1.0.3 or up) in 64 bit size. Changed: Internal cookie stuff remade 1.0.14 Unreleased version 1.0.15 Added: SITE XWHO and added ini example to this file. Added: Multiple SuperUser entries are now possible 1.0.16 Changed: OnEverySecond didnt work I had left some debug code in there. Changed: Added a complete ServuEvent.ini 1.0.17 Fixed: error on cookie translation could cause comamdn not to work 1.0.18 Fixed: %[SPEED] %[DOMAINPORT] %[DOMAINID] %[SIZE] %[DURATION] didnt work Added:SITE HELP - shows the help file 1.0.19 Fixed: %[TOTALSPEED],%[TOTALSPEEDDOWN],%[TOTALSPEEDUP] didnt always show the correct amount Changed: Speeded up the total counts a minor amount, even tho you shouldnt notice a difference. 1.0.20 Changed: user speed and state reset after the EndUp,EndDown,AbortUp,AbortDown event has executed. Added: simple stats module. 1.0.21: Changed: EndUp,EndDown,AbortUp and AbortDown will set the user to idle when the command is triggered. This is because the event is triggered AFTER it occurs. 1.0.22: Idle count of users was incorrect 1.0.23: Some of the Up and Down counters were wrong. 1.0.24: SITE WHO now is also changeable just like SITE XWHO. 1.0.25: Added: Cookies now can be used with width and alignment 1.0.26: Fixed: Stats with empty user name could be written when username isnt known yet (e.g. login with bad password) 1.0.27: Added:User depending events. 1.0.28: Support for cookies that are in the ServuDaemon.ini/Serv-U.ini file 1.0.29: It was needed for the ServuEvent.ini to be where the ServuEvent.dll was. Now if ServuEvent.ini isnt there it will try to locate this file where the ServuDaemon.exe (or Serv-U32.exe) is. 1.0.30: In some previous version I left out %[EVENT] and %[SUBEVENT], they are back now. These are user cookies. %minwidth.maxwidth[cookie] now also works for ini cookies. Removed %[GROUP] since it already is in the ini file. 1.0.31: Fixed: %[FILENAME] and %[DIRNAME] showed the full path instead of a part of the path Added: HomeDir= used for initial %[DIR] setting. 1.0.32: Important security fix, readini and some other commands worked for no admin user. Serv-u 5.x type ini ini file now also recognized. 1.0.33: Change in this documentation falup and so was not updated. Should be FilesAlUp etc.. Added multiple file [FILES] entries to show a file. Fixed: Events didnt get properly fired. Removed: GuildFTPD support revoked. Guild already has its own event mechanism which works fine with all my other tools. Servuevent apparently doesnt get used with guild, and apart from that there is still no final out from GuilfFTPD. Changed: ServerType= changed, no longer needed for Serv-U 3.x and up. 1.1.0: TimeOut= now also for a user WrongPass= now also for a user All commands no matter what can be hooked now Drastic changes in the code. ini file doesnt get read now every time it is needed, only a SITE REHASH will reread the ini file settings. Pre commands with console piping added. Permissions added. Cookies added. User ini part is read once the user is logged in not anytime everytime a cookie needs to gets parsed. %[ARGSALL] and %[ARG0] and up cookies added 1.1.1: Fixed:[FILES] section wasnt read properly, now it works again. 1.1.2: Fixed:Events didnt get started properly. 1.1.3: Added: System Administrators (Maintenance=System in ServuDaemon.ini) are automatically superusers. Added: SITE REBOOT, POWEROFF, SHUTDOWN added Fixed: ini file wasnt read when ServerType wasnt filled in Fixed: %[ID] didnt get resolved Changed: Processlist now shows the parent process as well Added: RFC 959 console reply enforcement Added: KILL time for a running subprocess, not working yet Readded: IniFile= in ServuEvent.ini to check for another ini file instead of ServuDaemon.ini/Serv-U.ini Fixed: Multiple lines from the ini file were read as a single line (e.g. for SITE WHO). Fixed: rfc959 describes \r\n as line terminators even tho \n seems to suffice, now \r\n is taken Changed: PIPE,DONT etc now completely replaced by more options. Changed: Events are changed, now a KILLTIME and WINDOWMODE is added 1.1.4: Changed: SITE PROC LIST now shows the running processes in a tree form Changed: SITE REBOOT, SITE SHUTDOWN, SITE POWEROFF changed to work with XP, should work on win9x as well (untested) 1.1.5: Tested: SITE REBOOT, SITE SHUTDOWN, SITE POWEROFF works Fixed: Event didnt work at and after the second login, 'invalid handle value' was being caused. 1.1.6: Fixed: Timer didnt work as it should 1.1.7: Fixed: Wrong stdin, stderr, stdout handler for the timer made it impossible to call batchcommands. 1.1.8: Fixed: User events were still in the old format, upgraded to the same format as global events. 1.1.9: Changed: All processes now start in the current working dir where the user is at. So all commands should work from there. Changed: The processes for the Started, Stopped, EveryDay, EveryHour, EveryMinute, EverySecond run in the Servu server dir Added: %[SERVUDIR] cookie Changed: User events did not get the handles inhereted, which resulted in the inability to run batch files for userevents. 1.1.10: Fixed: crash in ServuEvent.dll when a double space was in the FTP client command. 1.1.11: Fixed: due to the fact that ServuAdmin.exe removes unrecognised entries from the user settings out of the ServuDaemon.ini file I had to move the user settings to Users.ini. 1.1.12: Changed:%[PASSWORD] now holds the password correctly (only Serv-U 3.x and up, for 2.x only anonymous user password is here) Fixed:%[NAME] and %[PASSWORD] is now available when a BouncedIP is detected and also when a bad login occurs. 1.1.13: Changed:it seems I forgot SHOW as window option. 1.1.14: Changed:Version 2.x code removed to ServuEvent2x project. Now only support for 3.x and above. Changed:Instead of a single User event there are now multiple user events possible. 1.1.15: Fixed: homedir wasnt set during login which caused a pre event to give an 'unknown directory' error and thus it didnt trigger directly after login Changed: login settings were set twice, kinda overdone. Changed: users were incorrectly named in the users.ini, changed from [username|domainnumber] to [USER=username|domainnumber] Added: Groups.ini they are stored as [GROUP=groupname|domainnumber] Added: Events for groups (no multiple group events yet that will come in a next version). 1.1.16: Changed: Events for groups are now multiple events, meaning if a user is in multiple groups all events for those groups will be triggered. Changed: in the [Pre] section the pre commands now also have %[FILE],%[FILENAME],%[DIR],%[DIRNAME],%[RENAMEFILE],%[RENAMEFILENAME] working. The argument for the command in question (STOR, APPE, RETR, RNFR, DELE, XCRC, STAT, MKD, RMD, RNTO) are taken from the argument of the command 1.1.17: Fixed:%[Group] cookie didnt show up, as did any other ini based cookie didnt work properly. 1.1.18: Changed:FULL mode changed, >0 and <0 are command fail states, =0 is the command allowed status. Added: ServuEvent error: message with the error that should give the information why a certain pre event does not work (bad commandline usually) Added: Sub processes get terminated if they hang too long in a [pre] event. 1.1.19: Changed: Internal wait for threads is increased. Changed: " Process is terminated" is replied when a pre event aborts the command due to a timeout. Added: KillTime removed, Timeout is the one to use. Warning: this means that the whole KILLTIME is removed from the ini file, so update your ini files. 1.1.20: Added: FilesSession and Session cookies Fixed: Stats were counted per session, this would give bad values when taken over a user+domain if someone logged in multiple times. 1.1.21: Added: CountDownUser, CountDownIP, CountUpUser, CountUpIP, CountUser, CoundIP cookies added Fixed: some memory wasnt freed properly, this could cause servuevent.dll to go wrong after many connections Fixed: Some counts were wrong 1.1.22: Changed/Fixed: For debugging I had the Every* events commented out, I forgot to put them back. So now they work again. Fixed: CountUpUser and so were wrong in this text file, I changed them to CountUserUP etc. 1.1.23: Added: PathServu and PathServuEvent cookies. Removed: ServuDir cookie. Changed: Cookies are more readable now, they are case insensitive so it should bother in your scripts Fixed: Strange behaviour when properly closing down seru via the administrator (could cause a crash in my dll). 1.1.24: Fixed: iniFile= didnt behave properly when used, the Users.ini and Groups.ini were wrongly set. 1.1.25: Fixed: bad %[Time] value 1.1.26: Fixed: bad user ini cookie comparison routine that appeared in %[Time] which got the value of TimeOut=... in there. 1.1.27: Changed: As of serv-u version 6.3.0.0 the internal structure changed so I needed to make a similar change in my dll 1.1.28: Fixed: trying to log in with a bad user/pass and then logging in with a correct user/pass caused events to not occur for that user. 1.1.29: Added: Normal events now can create a ServuEventError.log file if an error occurs in the event. Fixed: Events and other things no longer worked on version 1.1.28 and a servu version lower then 6.3.0. The evt structure had changed and I didnt update it correctly for old versions. 1.1.30: Fixed: %[IP] wasnt correct Changed: [Event] lines can now be without | so EndUp=c:\something.exe will run. The mode is then HIDE with timeout of infinite. Fixed: Up and Down stats were added together. Now they should be properly seperate. 1.1.31: Fixed: site help caused a crash if the help file did not exist 1.1.32: Fixed: bug that occured during site command (could occur at other places too). 1.1.33: Changed: For odbc/registry user settings the home dir can not be retrieved so in that case the current dir where an event is started in is wrong since it is empty. In this special case the current dir is set to the dir in whcih ServuEvent.ini is. 1.1.34: Fixed: The Connect= event had a bad starting dir, this event will now always start from the dir where ServuEvent.dll is. Changed: As a result of this whenever a starting dir is unknown it will be the servuevent.dll dir. This only happens during Connect and during Login with no HomeDir setting. ToDo list: user data from and to registry user data from and to ODBC site administrator commandset support TIMEOUT implementation in the events (already implemented in the pre section) SITE SERVICES implementation. [post] events Events reply and having events cause the client to wait. HookReply for complete replies even if a program is passed to the next dll (tricky one for all commands that use a dataport as RETR, STOR, LIST, ..). site maintenance commands and remote administration through SITE commands (low priority servu admin already handles that) dde commands to other programs (mirc, database apps) telnet commands to eggdrop