
                        Specification for WGSRBA.EXE
                             Rebuild GALALS2.DAT



Overview

This program will read the user database (WGSUSR2.DAT), and then make sure
there is a valid entry for each User-ID in the GALALS2.DAT file. Alias
collision checks are made for each User-ID. If the GALALS2.DAT file is
missing, it will create one and create valid entries for each User-ID.

Command Interface

The initial version of WGSRBA does not take command line parameters, but the
output from the program can be piped or redirected.

     WGSRBA [[| command]|[> file]|[>> file]]

The program will not run if any Worldgroup Server applications are running.

Initial Processing

If the file GALALS2.DAT does not exist, we will create a new one from the
GALALS2.VIR file.

Files Processed

GALALS2.DAT and WGSUSR2.DAT (this latter file is used in a read-only mode).

Possible Record Alterations.

Records in GALALS2.DAT may be created, added, deleted, modified or ignored.
Except for a delete or create record, the ALIAS field for an existing record
will never be altered. In the case of a create, the Alias field will be left
empty.

Data Processing

Check Alias Against A User-ID From WGSUSR2.DAT

As each User-ID is pulled out of WGSUSR2.DAT, we scan GALALS2.DAT to see if an
entry exists. If it exists, we will verify it's default alias and if we need
to make one, we will make sure it doesn't collide with an existing Alias or
Default Alias.

Several conditions will cause a report message to be sent to STDOUT where it
can be read or redirected to a file for later processing.

Record exists for the User-ID

The Default Alias exists

The record is skipped.

The Default Alias does not exist

The record is checked to see if an Alias exists.

An Alias does exist

The record is skipped.

An Alias doesn't Exist

The flag to prompt for an alias is set and the record is updated. A default
Alias is never created in this situation since it could cause an existing
alias to have a colision that it did not previously have.

It is reported that this User-ID does not have an Alias or a Default alias.

Record does not exist for the User-ID

A possible Default Alias is created and checked for collision with another
Default Alias.

The Default Alias does collide

A record is created that contains only the User-ID and the flag to let the
user know that they need to set an Alias is set.

This is reported as an alias collision.

The Default Alias doesn't collide

A record is created that contains the User-ID and the Default Alias.

Check User-ID Against A User-ID from GALALS2.DAT

The GALALS2.DAT file is scanned each USERID in a record is checked against the
WGSUSR2.DAT file.

Lookup The Current Alias User-ID in WGSUSR2.DAT

See if the current GALALS2.DAT recored, USERID field exists in WGSUSR2.DAT.

GALALS2.DAT User-ID matches WGSUSR2.DAT User-ID

The record is ignored.

GALALS2.DAT User-ID doesn't match WGSUSR2.DAT User-ID

The record in GALALS2.DAT is deleted.

This is reported as an Invalid User-ID.

Processing Reporting

The Processing Summary is spooled to STDOUT where it can be viewed on the
screen or redirected to a file for later review.

Phase One Reporting

The number of records processed, records skipped, records added, records
modified and the number of collisions is reported.

Phase Two Reporting

The number of records Verified and Deleted is reported.

Special Considerations

The actual Alias field in GALALS2.DAT is never altered. Though the record will
be deleted in phase two if the User-ID field is invalid.

Possible Future Enhancements

The following enhancements could be added at a future time.

Verbose reporting

Detailed reporting of all processing could be generated if a command line
argument is present "/v". Most of this code is present, but commented out
since it was only used for debugging and verification of program operation.

Add WGSRBA to Offline Utilities WGSRIDX processing.

The program could be included with the existing rebuild utilities that are
currently run when WGSRIDX runs from the Offline Utilities menu.

Other

The utility has been tested with Worldgroup 3.00 and 3.10 for NT/95 and works
with both versions. It should be checked for compatibility with Worldgroup
3.00 and and 3.10 (when available) for DOS.