Proactive events, also called “Before” events, let ProVide act on an operation before it completes, so you can allow it, block it, or change what it does. With before-scripts you can limit access based on date and time, on files already downloaded, or on data held in an external database, and you can even alter the target an operation is about to act on. Paired with Reactive (after) events, this turns ProVide into a full integration server. These events can be overridden per user or per group, on top of your server-wide defaults.
To learn more about the Events and Messages module, see Proactive events, and the User guide for further detail.
Return codes for “Before” events #
Some “Before” events support an alter capability, where the script’s return code tells ProVide how to proceed:
0: proceed as normal.1: prevent the action and notify the user with custom return information.2: proceed, but perform the action on the item returned by the script.
Available events #
Each “Before” event is paired with the matching “On” event that fires once the action occurs.
BeforeConnect: before a user connects.OnConnect: when a user connects.OnQuit: when a user sends QUIT.OnDisconnect: when a user disconnects.BeforeLoggedIn: before a user is authenticated.OnLoggedIn: when a user successfully logs in.BeforeChangeDirectory: before a user changes directory.OnChangeDirectory: when a user changes directory.BeforeCreateDirectory: before a directory is created.OnCreateDirectory: when a directory is created.BeforeRemoveDirectory: before a directory is removed.OnRemoveDirectory: when a directory is removed.BeforeListDirectory: before a file listing.OnListDirectoryStart: when a listing starts.OnListDirectoryEnd: when a listing ends.BeforeDownload: before a download starts.OnDownloadStart: when a download starts.OnDownloadEnd: when a download ends.BeforeUpload: before an upload starts.OnUploadStart: when an upload starts.OnUploadEnd: when an upload ends.BeforeRemoveFile: before a file is removed.OnRemoveFile: when a file is removed.BeforeRename: before a file or folder is renamed.OnRename: when a file or directory is renamed.BeforeCopy: before a file or folder is copied.OnCopy: when a file or folder is copied.
Available tokens #
Date and time #
%YYYY%: current year%MM%: current month, two digits (01–12);%M%: current month (1–12)%DD%: current day, two digits (01–31);%D%: current day (1–31)%hh%: current hour, two digits (00–23);%h%: current hour (0–23)%mm%: current minute, two digits (00–59);%m%: current minute (0–59)%ss%: current second, two digits (00–59);%s%: current second (0–59)
Statistics #
%TOTAL_DOWNLOADED%: total data downloaded from the server%TOTAL_UPLOADED%: total data uploaded to the server%TOP_n_DOWNLOADERS%: list of the top n downloaders (n is set by you, e.g.%TOP_15_DOWNLOADERS%)%TOP_n_UPLOADERS%: list of the top n uploaders (e.g.%TOP_7_UPLOADERS%)%TOP_DOWNLOADER_n_USERNAME%: username of the nth top downloader (e.g.%TOP_DOWNLOADER_8_USERNAME%)%TOP_DOWNLOADER_n_DOWNLOADED%: data downloaded by the nth top downloader%TOP_UPLOADER_n_USERNAME%: username of the nth top uploader (e.g.%TOP_UPLOADER_14_USERNAME%)%TOP_UPLOADER_n_UPLOADED%: data uploaded by the nth top uploader
Server #
%CONNECTIONS%: current number of connections to the server%USERS_LOGGED_ON%: current number of users logged on%SW_NAME%: server program name;%SW_VERSION%: version;%SW_BUILD%: build
User #
%IP%: IP of the current user%CONNECTION_TYPE%: protocol of the incoming connection, e.g. FTP%USERNAME%: username of the connected user%GROUPS%: single-quoted, space-separated list of the user’s groups%FTP_DIRECTORY%: FTP directory of the current user%LOCAL_DIRECTORIES%: single-quoted, space-separated list of local directories for the current FTP directory%FTP_FILENAME%: last file accessed by the user (FTP path)%LOCAL_FILENAME%: last file accessed by the user (local path)%TRANSFERRED%: bytes transferred during the last command%FILESIZE%: size of the last file accessed%LINK_TYPE%: link type for the connection (empty,ltShare,ltReceive, orltCollaborate)%AD_DISPLAYNAME%,%AD_HOMEDIR%,%AD_COMMENT%,%AD_SCRIPT%,%AD_PHONE%,%AD_MAIL%: display name, home directory, comment, logon script, primary phone, and primary email from Active Directory for the current user%EXPIRE_TYPE%: expiration type for the user (empty,etDate,etDownloads,etUploads,etLogins,etDays,etWeeks, oretMonths)%EXPIRE_VALUE%: expiration value (empty, an ISO date, or a number)
Scripting #
%EVENTNAME%: name of the triggered event%FORM%: ampersand-separated, percent-encoded (URL-encoded) representation of the form specified during upload (any form ID is appended as%FORMID%)%EXECUTE(cmd)%: runs an external command and returns the result
Where to find these settings #
Log in to the web-based Admin interface with an account that has Admin privileges, then click Events and Messages in the top menu under Details.
