From:	SMTP%"ewilts@GALAXY.GOV.BC.CA"  7-AUG-1993 11:51:24.10
To:	EVERHART
CC:	
Subj:	More NEWS_USAGE_LOG changes

Message-Id: <9308052005.AA16027@uu7.psi.com>
Date:         Thu, 5 Aug 1993 09:29:59 -0700
Reply-To: Ed Wilts <ewilts@GALAXY.GOV.BC.CA>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: Ed Wilts <ewilts@GALAXY.GOV.BC.CA>
Organization: BC Systems Corporation
Subject:      More NEWS_USAGE_LOG changes
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>

More patches to the way NEWS_USAGE_LOG works...

There has traditionally been 2 loopholes whereby people could read News without
having an entry in NEWS_USAGE_LOG.  One of these I posted patches for yesterday
(moving the log_to_usage_file call from item_update to do_display).  The
loophole was that if you first SKIP'ped an article and then went and read it,
it wouldn't be counted.

The second loophole was that you could do all of your reading, issue a
CHECKPOINT command to update your NEWSRC file, and then ^Y out of News to
bypass the usage log.  To fix this, I've put in two changes.

In NEWSUTILITY.C, add the following line:
  if ( (read_count + post_count) == 0 ) return;
Unfortunately, I ended up purging my source so I can't post the exact diff, but
it goes into the log_to_usage_file module right before the comment "Translate
logical name." near line 3493.  A side-affect of this change is that if anyone
enters News but doesn't read or post any articles, no entry will be written to
the usage file.  That's fine since this function isn't meant to replace image
accounting anyway.

The second change is DIFF'ed below.
************
File NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;3
    1   /*Last Modified:  5-AUG-1993 08:53:37 by EWILTS : NEWSRC.C*/
    2   /*
******
File NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;1
    1   /*
************
************
File NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;3
  557     log_to_usage_file(1,0);
  558     log_to_usage_file(0,0);
  559     if ( newsrc == 0 ) {
******
File NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;1
  556     if ( newsrc == 0 ) {
************

Number of difference sections found: 2
Number of difference records found: 3

DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SR
C]T.T;1-
    NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;3-
    NEWS_MANAGER_DEV:[SOURCE.NEWS61B7.NEWS_SRC]NEWSRC.C;1

Basically what this latter change does is to update NEWS_USAGE_LOG whenever the
CHECKPOINT command is issued and all variables reset.  If this change is made
and the patch to NEWSUTILITY.C is not applied, you'll have two entries in
NEWS_USAGE_LOG for a normal exit.

--
Ed Wilts, BC Systems, 4000 Seymour Place, Victoria, B.C., Canada, V8X 4S8
EWilts@Galaxy.Gov.BC.CA     Office:  (604) 389-3430   Fax: (604) 389-3412
