home *** CD-ROM | disk | FTP | other *** search
- ; Title : SMART.TSK Last Updated : July 24, 1991
- ; Author : Steve Johnson - FmP. Version : 1.20
- ; Purpose : User oriented menu interfaced to EUC
- ; Notes : Uses SAVE and RESTORE to file called SMART.TM
- ; The task validates usernames and passwords against EUC
- ; catalogue. Allows a "standard" list of applications to
- ; be edited.
- ; Task screen output is to screen 1, Application O/P to 0.
- ; Latest : Support for networking revised.
-
- int column
- int count
- int i
- int line
- int ug
-
- logical auto
- logical forever
- logical save_reqd
-
- vconst cls,11
- vconst cel,55
- vconst cep,56
-
- var char,1
- var descriptions,15,occurs 7,
- 'On-line Manual '
- 'SCR manual '
- 'Database '
- 'File Transfer '
- 'Leisure ware '
- 'Development '
- 'Wordprocessing '
-
- var fmpdir,64,$fmpdir
- var fmpcat,64,$fmpcat
- var loginpath,64
- var login_error,32,'Invalid login - please retry...'
- var null,1
- var pass,16
- var screen_line,80
- var tme,4
- var uname,16
-
- var path,20
- var paths,20,occurs 7,
- ". "
- ". "
- ". "
- ". "
- "\flsim "
- ". "
- ". "
-
- èvar parameter,20
- var parameters,20,occurs 7,
- "TMMAN "
- "SCRMAN "
- " "
- " "
- " "
- "TMDEV "
- "WORDPROC "
-
- var program,8," SMART"
- var programs,8,occurs 7,
- "TM "
- "TM "
- "PROTEAN "
- "XPORT "
- "fs3 "
- "TM "
- "TM "
-
-
- end
- lookfor "smart.ovr"
- if not found
- forms logon.ovr ;in case /q and not registered
- insert program program
- put "NO_FORMS"
- stop
- fi
- display cls
- screen 1
- display cls
- screen 0
- if colour
- screen 1
- switch 1
- fi
- forms smart.ovr
- user loginpath ;Save initial directory
-
- restore 'smart.tm' descriptions programs paths parameters
- if resp ne 0
- if not colour
- clear count
- until count = 7
- if entry count of programs = "TM "
- move "TM /m " to entry count of programs
- fi
- fi count
- fi
- save 'smart.tm' descriptions programs paths parameters
- if resp ne 0
- wait 'SMART: Unable to save data to SMART.TM'
- stop
- fiè save
- else
- restore
- fi
- if fmpcat = null
- if fmpdir = null
- move '\fmp' to fmpdir
- fi
- else
- move fmpcat to fmpdir
- fi
- dir fmpdi≥ '\º catalog.euc
- if not found
- put "NO_CATALOGUE"
- screen 0
- switch 0
- stop
- fi
- catalog fmpdi≥ ;open the catalog ready for use
- if resp ne 0
- displayln "Unable to opeε thσ cataloguσ iε directory: " fmpdir
- wait
- stop
- fi
- until forever
- display cls
- move 1 to resp
- until resp = 0 or auto
- put 'LOG' noclear
- CLEAR uname
- get uname pass
- if funkey = 10
- put "EGRESS"
- get forever
- if forever
- screen 0
- switch 0
- stop
- fi
- move 1 to resp
- else
- if fk1
- put "DUMMY_CAT" wait 0 noclearè move 1 to resp
- else
- login uname pass ug
- if resp = 3
- cursor 12 10 'User ' uname ' already logged-in'
- else
- if resp <> 0
- put "DUMMY_CAT" wait 0 noclear
- insert login_error
- move 1 to resp
- fi
- fi
- fi
- fi
- fi
- move 0e040h to bbmask
- display cls
- userline 'Current user is ' uname
- move 10 to timer
- menu 1,'SERVICES',descriptions
- option 1,1,7
- if choice = 5
- move time to tme
- if tme > '12:0' and tme < '13:3' or tme > '17:3' or tme < '08:3'
- else
- cursor 18 0 "This is COMPANY TIME - games available "
- display "noon > 1:30 and after 5:30 p.m."
- cursor 19 0 "Please try later " UNAME 2
- wait
- cursor 18 0 cel
- cursor 19 0 cel
- if keyval = 'O' ;Press O to override time check...
- else
- return
- fi
- fi
- fi
- move choice to i
- decrement i
- move entry i of programs to program
- if program = spaces
- display 5 "No details yet supplied"
- move 8 to choice
- return
- else
- move entry i of paths to path
- move entry i of parameters to parameter
- if parameter ct '?'
- insert program
- fieldfill parameter
- put "EDIT_PAR" noclear
- get parameter
- fi
- fi
- trim path
- if path ne spaces and path ne '.'
- if path sw '~:\'
- select path
- fi
- user path
- if resp ne 0
- cursor 0 0 'Unable to select specified path - abandoned'è return
- fi
- fi
- if colour
- screen 0
- userline 'Attempting to run application in screen number zero..'
- switch 0
- fi
- display cls
- trim program parameter
- run program 1 parameter
- if colour
- switch 1
- screen 1
- fi
- select loginpath
- display cls ;in case app overwrote it!
- userline 'Current user is ' uname
- user loginpath
- return
-
- option 1,8
- if ug ne 99
- cursor 17 0 "Please login as user in group 99 to amend list"
- cursor 18 0
- wait
- cursor 17 0 cel
- cursor 18 0 cel
- move 10 to choice
- return
- fi
- clear count save_reqd
- until count = 7 or fk2
- fieldfill entry count of descriptions
- fieldfill entry count of programs
- fieldfill entry count of paths
- fieldfill entry count of parameters
- put application_detail noclear
- get entry count of descriptions
- get entry count of programs
- get entry count of paths
- get entry count of parameters
- if not anyfk
- move true to save_reqd
- fi
- fi count
- if save_reqd
- user loginpath
- save 'smart.tm' descriptions programs paths parameters
- if resp ne 0
- wait 'SMART: Unable to save data to SMART.TM'
- stop
- fi
- save
- fiè cursor 17 0 cep
- put "CLEAR" wait 0 noclear
- return
-
- option 1,9
- put 'NEWPASS' noclear ul ''
- display cls
- if funkey = 10
- return
- else
- get pass
- password pass
- fi
- return
-
- option 1,10
- option 1,30
- logout
- clear auto
- exitm
- option 1,31
- put 'HELPSCREEN'
- move hilite to choice
- return
- option 1,32
- put 'HELPSWITCH'
- move hilite to choice
- return
- option 1,39
- if colour
- SCREEN 0
- userline 'Contents of page 0...Press any key'
- switch 0
- inkey char
- if colour
- screen 1
- switch 1
- fi
- else
- userline "F9 key is not applicable on mono monitors"
- fi
- move hilite to choice
- clear bbdisp
- return
- option 1,99
- move hilite to choice
- increment choice
- move true to auto
- exitm
- endm 1
- fi
-
- endtask
-
- @VIDEOè@HEAD LEFT,'Taskmaster Example'
- @HEAD RIGHT,'EUC Controlled Access'
- @HEAD centre,'User Login'
- @NF LOG
- @acceptfk f1,f10
- @window line0,column0,depth1,width1
- @col char,cyan,blue
- @bright
- @banner
- @COL CHAR,YELLOW,BLACK
- @DRAW
- @STR MIN1
- @STR
- >Y<
- Entry to this application is controlled by EUC,
- the Taskmaster END USER COMPUTING Facility
- F1 for Username list. Press F10 to quit.
- >A<
-
- USERNAME [guest ]
- PASSWORD [! ]
- { }
- >A<
- >Y<
- @COL CHAR,YELLOW,BLACK
- @END
- @NF SERVICES
- @acceptfk f1,f2,f9
- @window line0,column0,depth1,width1
- @HEAD centre,'Service Selection'
- @col char,cyan,blue
- @banner
- @BBMENU WHITE,BLUE
- @wINDOW LINE 2,COLUMN 30,DEPTH 14,WIDTH 18
- @GON
- 7----------------9
- 0APPLICATIONS: 0
- 0{Archives }0
- 0{Comms }0
- 0{Database }0
- 0{File Transfer }0
- 0{Leisure ware }0
- 0{Spreadsheet }0
- 0{Wordprocessor }0
- 0FUNCTIONS: 0
- 0{Edit Apps List }0
- 0{Change Password}0
- 0{Logout (+Quit) }0
- 1----------------3
- @goff
- @colour char,cyan,BLUE
- @window line20,column18,depth2,width 42
- F1 or F2 for Help.
- F9 to view output from last application.
- @ENDè@NF clear
- @wINDOW LINE 2,COLUMN 50,DEPTH 14,WIDTH 25
- @end
-
- @NF NEWPASS
- @acceptfk f10
- @window line0,column0,depth1,width1
- @bright
- @COL CHAR,YELLOW,BLUE
- @STR
- @WINDOW LINE 16,COLUMN 17,DEPTH 8,WIDTH 46,pattern 176
-
-
- NEW PASSWORD ? [ ]
-
- @colour char,red,black
-
- Press F10 to Abandon change
- @END
- @nf APPLICATION_DETAIL
- @acceptfk f1,f2
- @STR MIN1
- @STR MIN1
- @path
- @STR
- @WINDOW LINE 17,COLUMN 0,DEPTH 5,WIDTH 80
- @dim
- @GON
- 7-Edit-and-press-<>-to-update-application-list:--(use--to-move)-------9
- 0 Description for menu [ ] 0
- 0 Application name [ ] Exclude .xxx (COM,EXE or BAT is implied) 0
- 0 Working Directory [. ] Note: a FULL STOP = current 0
- 0 Command line Parameters [ ] Optional: ? = prompt user 0
- 4-----------------------------------------------------------------------------6
- 1-----Press F1 to skip to next. Press F2 to skip remainder--------------------3
- @bright
- @END
- @nf helpscreen
- @head centre,"General help"
- @colour char,cyan,BLUE
- @banner
- @colour char,cyan,BLack
- @draw
- @colour char,cyan,black
- >1<
- This application is user-configurable allowing the user to fill
- in details of a list of up to seven applications.
-
- The task demonstrates the use of the SAVE and RESTORE commands,
- used here to remember details of the applications.
-
- The task also makes use of the SWITCH and SCREEN commands
- allowing output from the applications to remain on the screen and
- be accessible by use of the F9 key. THIS IS NOT DONE ON MONO
- VIDEOS.è
- Please note that the leisureware option is only available between
- certain specified times showing use of the TIME system variable.
-
- The menu has been made to TIME-OUT after 10 seconds automatically
- selecting the next topic.
- >1<
- @end
- @nf helpswitch
- @head centre,"Help on screen switching"
- @colour char,cyan,BLUE
- @banner
- @draw
- @colour char,cyan,black
- >1<
- Typical MS-DOS CGA video adaptors maintain 4 separate pages of screen
- memory and Taskmaster is able to switch between them. This task assumes
- that if the video is not colour it has only one page.
-
- Many applications write directly to the first of these screens
- (directly to the hardware); because of this behaviour, this particular
- task arranges to use screen 1 (the second screen) for all its normal
- output (if CGA or above).
-
- Having adopted this approach the F9 key has been utilised to display
- the contents of screen 0 (which normally contains the output of the
- last command issued).
-
- Incidentlly using Taskmaster one may write to a screen which is
- currently not being displayed.
- >1<
-
- In a secure task, exit to the System prompt can be prevented. To exit
- this task logout and press F10 at the login screen. Note that Taskmaster
- can disable Control/break and Control/C keys if required.
- @end
- @nf egress
- @acceptfk none
- @log
- @head centre,"Exit from SMART task"
- @colour char,cyan,BLUE
- @banner
- @draw
- @colour char,cyan,black
- >1<
- To maintain a secure installation the ability to exit to the system
- prompt would need to be restricted to certain users, or members of
- specified user groups; but as this is just a demo you may leave.
-
- @bright
- Do you want to exit SMART.TSK ? [Y]
- >1<
- @end
- @nf NO_CATALOGUE
- @dimè SMART.TSK error: Cannot locate/read the catalogue file maintained by EUC.
-
- If you have EUC (Not supplied with the Shareware version): Please run it
- to set up a catalogue in the current working directory.
-
- If you don't have EUC: A file named CALALOG.EUC is supplied with all
- Taskmaster issues, you will not be able to edit the catalogue without
- EUC but you will be able to use the dummy names catalogued within it to
- run those applications that are interfaced to EUC (for example SMART.TSK
- and CONFIG/STANDARD).
-
- During use the catalogue is updated by Taskmaster, recording details of
- users, dates and times of login and logout, name of last menu used the
- option selected etc. CATALOGV.EUC is an exact copy of CATALOG.EUC as
- issued.
- @end
- @nf DUMMY_CAT
- @WINDOW LINE 2,COLUMN 51,DEPTH 1,WIDTH0
- @dim
- The dummy catalogue contains
- these names, passwords and
- group numbers:
- @gon
- 7-------8----------8-------9
- 0 Name 0 Password 0 group 0
- 4-------5----------5-------6
- 0 guest 0 0 10 0
- 0 Bill 0 Access 0 20 0
- 0 Phil 0 Secret 0 30 0
- 0 Joan 0 a1b2c3 0 99 0
- 0 ADMIN 0 FMP 0 99 0
- 1-------2----------2-------3
- "UPPER" and "lower" case are
- NOT considered the same in
- usernames and passwords.
-
- Once logged in you may
- change the password. If you
- do then only you and the EUC
- administrator will know it!
- You may copy CATALOGV.EUC to
- CATALOG.EUC to restore them.
- @end
- @nf edit_par
- @acceptfk none
- @str
- @window line20,column 10,depth3,width60
-
- Please edit parameters for { } [ ]
- @end
- @eof
-