program newsdis !++ ! FACILITY: NEWS - System bulletin service. ! ! ABSTRACT: ! NEWSDIS disables users from using the NEWS service. ! This program sets the maximum message to 999 for a ! specified user effectively disabling that user from ! the news system. ! ! ENVIRONMENT: VAX/VMS V4.x ! ! ! AUTHOR: A. Potter, Rochester Inst. Tech. CREATION DATE: unknown ! ! MODIFIED BY: ! Rand P. Hall 14-May-85 ! Removed lock management code, it's not worth ! the effort and resources. Fixed a big logic ! error in main-line code.(Can't remember what though) ! VERSION: ! 01 - original ! 01.1 - [rph] Remove lock management, logic fix. ! !-- implicit none logical*4 stat integer*4 cli$present integer*4 set_usermax,stat integer*2 usermax character*10 username*12 stat = cli$get_value('DISABLE',username) if (stat) then call set_usermax(999,username) print *, 1 'User '//username//' disabled from NEWS.' call exit else call lib$stop(%val(stat)) endif end !+++ ! SET_USERMAX ! This routine sets the maximum number of messages read ! to 999 essencially locking the user out of NEWS. ! !--- subroutine set_usermax(lastitem,username) implicit none parameter NEWSUSERS='NEWS$DIR:NEWSUSERS' parameter NEWSUNIT=101 integer*2 lastitem, itemcode character*12 username external msg_panic ! Open the data file. open (unit=NEWSUNIT,file=NEWSUSERS,status='old', 1 form='formatted',access='keyed', 2 key=(1:12:character),recordtype='variable', 3 carriagecontrol='none',recl=20, 4 organization='indexed',shared,err=10000) ! Write or rewrite the record (whichever is necessary). read (NEWSUNIT,10,err=20,key=username) username rewrite (NEWSUNIT,10) username, lastitem 10 format (a12,i4) goto 30 20 write (NEWSUNIT,10) username, lastitem goto 30 ! Close data file. 30 close (unit=NEWSUNIT) return 10000 call lib$stop(msg_panic) end