Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 10
Controlling Logon
the TACL process. The display message is typically used to give a reason for the
rejection.
The following code fragment checks a flag value before deciding whether to accept the
prelogon request. On rejection, this example returns the generic text “Prelogon
rejected” to the TACL process; a typical response would indicate the reason for
rejection:
CALL READUPDATEX(RECV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF BUFFER[0] = -59 THEN
BEGIN
IF ACCEPT^PRELOGON = YES THEN
BEGIN
PRELOGON^REPLY.REPLYCODE := 0;
REPLY^LEN := 2;
END
ELSE
BEGIN
PRELOGON^REPLY.REPLYCODE := 1;
PRELOGON^REPLY.REPLYTEXT ':=' ["Prelogon rejected",0];
SCAN PRELOGON^REPLY.REPLYTEXT[0] UNTIL 0 -> @LAST;
REPLY^LEN := 2 + @LAST - @PRELOGON^REPLY.REPLYTEXT[0];
END;
CALL REPLYX(PRELOGON^REPLY,REPLY^LEN);
END;
The Logon^msg Message
The Logon^msg message is sent to $CMON every time a user attempts to log on,
giving $CMON the opportunity to accept or reject the logon. Note that this message
does not contain information regarding whether the user is already logged on; that
Format of a Prelogon^reply structure:
STRUCT PRELOGON^REPLY;
BEGIN
INT REPLYCODE; ![0] if 0, proceed to VERIFYUSER;
! if 1, disallow logon
STRING REPLYTEXT[0:n]; ![1] optional display text;
! maximum length is 132 bytes
END;