; *****************************************************************
DESCRIPTION
; *****************************************************************. ; * *. ; * LASTON V 1.30 *. ; * *. - PowerPoint PPT PresentationTRANSCRIPT
; *****************************************************************; * *; * LASTON V 1.30 *; * *; * Written in PPL for PCBoard *; * *; * Designed By: Gary Meeker *; * *; * Began development: 04-01-93 *; * *; *****************************************************************;; This writes the entry:;; Last on: MM-DD-YY (HH:MM) for ? Minute(s) - #nn;; or;; Last on (n): MM-DD-YY (HH:MM) for ? Minute(s) - #nn;; to the CALLER Log showing the last date/time of the callers last call; as well as the number of times on the system. No variable exists yet; for minutes on last call. The Language Number chosen may also be shown.
STRING ConfigFile, LangList, ShowPrompt, ModemID, CallerID, LogText, JoinConfSTRING Language, Flags, last_date, last_time, last_length, times_on, PromptSTRING CharBYTE X, Count, AutoJoinINTEGER CallerNumBOOLEAN WrModem, WrCallSec, WrCallNum, WrLastOn, LogLine, Logon, Flag
WrLastOn = TRUE
; If command line parameter exists read itIF (TOKCOUNT() > 0) THEN GETTOKEN PromptELSE PRINTLN "Logging last access information." Logon = TRUEEND IF
;Force Prompt to UpperPrompt = UPPER(Prompt)
;Assume no language match or language number not desiredLanguage = ": "
ConfigFile = PPEPATH()+PPENAME()+".CFG"
IF (EXIST(ConfigFile)) THEN
;Read the list of language extensions from LASTON.CFG and tokenize them ;Read the control flags
FOPEN 1, ConFigFile, O_RD, S_DN FGET 1, LangList FGET 1, Flags
; If Command line given then find the Prompt replaced in config file
IF (!Logon) THEN Flag = FALSE WHILE (!Flag) DO
; Get the Prompt to test
FGET 1, ShowPrompt IF (ShowPrompt = "") THEN ; Exit if no more prompts Flag = TRUE ELSE ;Is this the prompt we replaced?
Char = LEFT(ShowPrompt, 1) IF (UPPER(Char) = Prompt) THEN ;Yes, then grab the text from the line LogText = MID(ShowPrompt, 2, LEN(ShowPrompt)-1) ;then show it and we are done. PRINTLN LogText Flag = TRUE END IF END IF ENDWHILE END IF FCLOSE 1
;Search for a match by comparing each extension in the list TOKENIZE LangList Count = TOKCOUNT() FOR X = 1 TO Count IF (LANGEXT() = GETTOKEN()) THEN Language = " (" + STRING(X) + "): " ; Make it read " (n): " END IF NEXT
;Parse the control Flags if given IF (Flags <> "") THEN TOKENIZE Flags GETTOKEN WrLastOn GETTOKEN WrModem GETTOKEN WrCallSec GETTOKEN LogLine GETTOKEN AutoJoin END IFEND IF
IF (Char <> UPPER(Char)) LET WrModem = FALSE
;Load U_ variablesGETUSER
; Get the Date of the last calllast_date = STRING(U_LDATE())
; Get the Time of the last call (in " (HH:MM) " format)last_time = " (" + LEFT(STRING(U_LTIME()), 5) + ") "
; Get the Duration of the last call - can't actually do this!last_length = "for " + STRING(U_TIMEON()) + " Minute(s)"
; Get the number of times ontimes_on = " - #" + STRING(U_LOGONS())
; Write The log entries.
IF (Logon) THEN ;If called with no parameter (like in the Logon Script)
LOG "Last on" + Language + last_date + last_time + last_length + times_on,0
IF (AutoJoin > 0) THEN JoinConf = TRIM(MID(U_CMNT1, AutoJoin, 4), " ") IF (JoinConf <> "") THEN IF (U_EXPDATE > DATE()) THEN ' Check expiration IF (CONFEXP(JoinConf)) LASTIN JoinConf ' Yes, ok if expreg ELSE IF (CONFREG(JoinConf)) LASTIN JoinConf ' No, ok if reg END IF END IF END IF
ELSEIF (!CALLNUM() > 0) THEN ;Only if a User is not logged on
IF (WrLastOn) LOG "Last on" + Language + last_date + last_time + last_length + times_on,0 IF (WrModem) THEN ModemID = MODEM() IF (ModemID <> "") LOG "Modem: " + ModemID, 0 CallerID = CALLID() IF (CallerID <> "") LOG "CID: " + CallerID, 0 END IF IF (WrCallSec) LOG "Caller Security: " + STRING(CURSEC()), 0
END IF
;If there is text to log & we want it logged then do so!IF (LogText <> "" & LogLine) THEN LOG LogText, 0END IF
END