You can extend TeleFinder by scripting an action to take place at the time that User Manager creates new user accounts in the TeleUsers database.
The action is defined by any application named "ProcessNewUser" in the same folder as User Manager. Whenever User Manager creates a new user account, it looks for a program called "ProcessNewUser" in its folder, opens it if necessary, then sends it the "Process New User" event.
The ProcessNewUser program can be a compiled application, or an AppleScript saved as application. When using AppleScript, save the script with the following properties.
- Kind: Application
This is necessary since User Manager can only send the "Process New User" event to other applications.
- Stay Open checked.
This option increases performance by keeping the applet in memory ready to accept events from User Manager.
- Never Show Startup Screen checked.
This is necessary so that the applet can run without user interaction. Otherwise, the applet will open a startup screen when it is launched, preventing it from accepting the "Process New User" event. from User Manager.
The Process New User event has the following properties.
- Event Class (UMan)
- Event ID (PrNU)
The Process New User event contains the following parameters
- User Name (UNam) the name (login id) of the new user as text.
- Mail Folder (Mail) the user's spool folder as an alias. This folder contains the user's email and optionally the web space and pub folders.
- User Record (URec) the record from the TeleUsers database for the user as a C structure. This parameter is unusable within AppleScript.
- User Type (UTyp) the class of user account as text. If the account is for a regular user the parameter contains "user". If the account is for an email gateway the parameter contains "gateway".
You can find a sample script in the User Manager folder. By default the sample script is inactive because it is named "(ProcessNewUser)". To activate the script rename it to "ProcessNewUser" by removing the parenthesis from the file name.
The sample script parses the Process New User event into individual variables then tells Finder to create a folder named "pub" in the users spool folder.