* PROGRAM SESSION * Use this in a logon script to prevent more than one session on a windows * workstation. This is not a security barrier, but merely a reminder. * To install: * 1. Put this routine in your program file. COMPILE and SETPROGRAM * 2. COPY VOC OFF LOGOFF TO:OFF1 LOGOFF1 * 3. Change the OFF and LOGOFF VOC items to: * TCL * SESSION OFF * 4. Add SESSION ON to your logon verb. * 5. Customize FILE_NAME below for your environment if necessary. * 05/31/96 - BTS - Original release * 06/13/96 - BTS - Add comments - PERFORM "OFF1" rather than R/Basic LOGOFF * 11/11/97 - BTS - Revise DOS file name logic for the error log DECLARE SUBROUTINE MSG * This file must be unique to each user STATION = FIELD(@STATION,"*",2) IF STATION THEN FILE_NAME = STATION[1,8]:".LOG" END ELSE FILE_NAME = "arevuser.log" END OPTION = FIELD(TRIM(@SENTENCE)," ",2) BEGIN CASE CASE OPTION = "ON" OSREAD DOS_DATA FROM FILE_NAME THEN IF DOS_DATA THEN MSG_TEXT = "|Another session is already active." MSG_TEXT:= "||":DOS_DATA MSG_TEXT:= "||Goodbye . . .|" MSG(MSG_TEXT) PERFORM "OFF1" END END ELSE DOS_DATA = @ACCOUNT:" ":@USERNAME:" ":@STATION:" ":TIMEDATE() OSWRITE DOS_DATA ON FILE_NAME END CASE OPTION = "OFF" OSDELETE FILE_NAME PERFORM "OFF1" CASE 1 MSG("|Syntax: SESSION {ON/OFF}|") END CASE END