Stock behavior: logon.wcx ships in wildcat.wcl and runs once a login succeeds on every protocol: Local, Telnet, Dialup, HTTP (wcWEB), Wildcat! Navigator, FTP, SFTP and POP3. Nothing needs to be installed for this to happen; it runs even if you never add a single hook.
With no hooks configured, logon.wcx just does the stock first-time checks (group selection, greeting, birthday, mail, bulletins, etc.) for Local, Telnet and Dialup, and does nothing further. The other protocols never run those checks; they have no interactive text screen to show them on.
Do not replace or edit logon.wcx. Add your own hook scripts instead, as described below. A logon.wcx placed in wc:\code\ overrides the stock one in wildcat.wcl, and an old copy there stops the protocol hooks from running.
logon.wcx tries three ways, in order, and stops at the first one that runs something:
| Protocol | Hooks-list file (in config\) | Legacy single name | Wildcard |
|---|---|---|---|
| Local / Telnet / Dialup | logon-hooks.txt | (none) | logon-*.wcx |
| HTTP (wcWEB) | httplogon-hooks.txt | httpLogon.wcx | httpLogon-*.wcx |
| Wildcat! Navigator | navlogon-hooks.txt | navlogon.wcx | navlogon-*.wcx |
| FTP | ftplogon-hooks.txt | ftplogon.wcx | ftplogon-*.wcx |
| SFTP | sftplogon-hooks.txt | sftplogon.wcx, or ftplogon.wcx if there is no sftplogon.wcx | sftplogon-*.wcx |
| POP3 | pop3logon-hooks.txt | pop3logon.wcx | pop3logon-*.wcx |
An existing site with its own ftplogon.wcx keeps working with no change; that is the "legacy single name" column. Because the hooks-list file is tried first, creating ftplogon-hooks.txt with any entries means ftplogon.wcx no longer runs on its own. List it in the file if you still want it.
Hooks-list file format (the same for every protocol): one script name per line, run in the order listed.
myhook
wc:\bin\otherhook.wcx
anotherhook, arg1 arg2
A blank default argument is paramstr(1) as passed to logon.wcx itself; a comma on the line overrides it, and %1 in that override is replaced with the original argument. Lines starting with ; or # are comments. A bare name is assumed to live in wc:\code\ with a .wcx extension unless it already starts with wc:.
Every hook runs as the logged-in user, after the login has succeeded. GetCallType() tells you the protocol, and GetCallerId() returns the client's IP address.
| Protocol | Output (PRINT) | Notes |
|---|---|---|
| Local / Telnet / Dialup | Shown to the user | Interactive: a hook can prompt for input. |
| FTP | Sent to the FTP client as reply lines | See FTPLOGON Hook Example for reply codes and GlobalResult. HangUp ends the session. |
| SFTP | Written to the wcSFTP log | SFTP has no text channel, so the client never sees it. HangUp ends the session; the activity log shows "Signed off (Force Disconnect)". |
| HTTP (wcWEB) | Discarded | Runs once when a web login succeeds, before the first page is shown, not on every page. |
| Wildcat! Navigator | Discarded | The global Navigator is TRUE. |
| POP3 | Discarded | Mail clients log in every time they check for mail, often every few minutes, so the hook runs on each check. |
Where output is discarded there is no user input either; use those hooks for side effects such as activity log entries, user variables and notifications. Keep every hook fast: the login waits for it to finish.