Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 8
Controlling Logon and Logoff
When you reply with the Config^reply message, you need to specify every value you
return. For example, if you want to change only one or two values and leave the
remaining values unchanged, you must specify the current values in the fields that
remain unchanged. An exception is when replying with a short message: for example,
if you want to change only the NAMELOGON parameter, then you could reply with a
message that is just seven words long; the AUTOLOGOFFDELAY,
LOGOFFSCREENCLEAR, REMOTESUPERUSERID, and BLINDLOGON parameters
must contain the current values, but the CMONTIMEOUT, CMONREQUIRED,
REMOTECMONTIMEOUT, REMOTECMONREQUIRED, NOCHANGEUSER,
STOPONFEMODEMERR, and REQUESTCMONUSERCONFIG parameters need not
be returned.
The following code fragment sets the values for AUTOLOGOFFDELAY (5 minutes) and
CMONTIMEOUT (40 seconds):
CALL READUPDATEX(RECV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF BUFFER[0] = -60 THEN
BEGIN
! Set the reply code to zero:
CONFIG^REPLY.REPLYCODE := 0;
! Set the new parameter values:
CONFIG^REPLY.AUTLOGOFFDELAY := 5;
CONFIG^REPLY.CMONTIMEOUT := 40;
! Set default values for other parameters:
CONFIG^REPLY.LOGOFFSCREENCLEAR := -1;
CONFIG^REPLY.REMOTESUPERUSERID := -1;
CONFIG^REPLY.BLINDLOGON := 0;
CONFIG^REPLY.NAMELOGON := 0;
CONFIG^REPLY.CMONREQUIRED := 0;
CONFIG^REPLY.REMOTECMONTIMEOUT := 30;
CONFIG^REPLY.REMOTECMONREQUIRED := 0;
CONFIG^REPLY.COUNT := 9;
CALL REPLYX(CONFIG^REPLY,$LEN(CONFIG^REPLY));
END;
Controlling Logon and Logoff
Your $CMON process can control attempts at logging on by accepting or rejecting
logon attempts and by having messages displayed. $CMON can also cause a
message to be displayed following either logoff or a failed attempt to log on.
The following paragraphs describe how to apply controls to attempts to log on, log off,
and failed attempts to log on.