(C) Copyright,  David H. Bennett, 1992

Program : RUC - RemoteAccess User Command Line Editor
David Bennett / 2/3/92 / Ver 1.1

This program will allow you make changes to a USERS.BBS record via the
command line or batch file.

Why RUC (and other 'license' type stuff) (ewww he's so professional!)

  I originally wrote this program to automate the registration process for
  new users.  Since I use a mail in registration,  It made it a lot easier
  for me to create a batch file that would reset a few flags,  upgrade the
  users security level,  optionally allow giving them some long distance
  netmail credit,  and posting a message to that user (Using the IMTHINGS
  program included with the IMAIL fido mail processor).

  At the time I wrote this program,  I couldn't find anything to do this
  job.  Using token parsers I had written for other projects and the
  STRUCT.110 file that was included with RA I was able to piece together a
  pretty eleborate program in just a couple of hours.  (More eleborate that
  I'll ever need).

  Since that time,  I recall seeing another command line USERS.BBS program
  in a SDS listing.  I don't know if source is included or if it costs
  money or not.  So I released this one free with source in the BBS spirt.
  (Us sysops have enough money problems to worry about without trying to
  grub money off of each other <Grin>).  So please feel free to use and
  distribute these programs as you wish,  No matter what your situation in
  life is.  

  Currently the program supports the USERS.BBS file as supported by
  RemoteAccess version 1.10 (This is the old QuickBBS Users.BBS file
  format with a few extra fields).  I'm not up on the current
  QuickBBS world, however this program just might work with Quick
  BBS provided they haven't done anything major to USERS.BBS in the
  last few years.
  
  I may add support in the future for the USERSXI.BBS extension that
  was added to RemoteAccess.  Right now I don't have any need to 
  automatically update these variables,  if you do, it shouldn't be
  a major deal to add that extention to the program.  If you do decide
  to tackle that job,  Please take note of the *vtokens[] structure in
  RUC.C and the token values in RUC.H,  If you follow this convention
  your job will be infinately easy (an afternoon project perhaps).

  I only ask a few things:

  - If you redistribute, please make sure all files are intact as you found
  them.  If you make modifications,  Clearly mark them as yours in the
  history table in RUC.C.  If you get a chance, send 'em back to Fido
  1:280/307 so I can keep a current revision list here.

  - Do not charge for this program.  Shareware librarys, vending machines,
  etc...  Can charge their reasonable disk charge.  There's enough
  competition in the Shareware distribution business that I don't think I
  need to stipulate any maximum dollar amounts.

  - Don't come after me if your computer blows up.  I don't think it will.
  However, you never know.  Always make sure you have good backups.  In
  any case,  I am not responsible!

  - If you have any comments, bug fixes, etc...  Please contact me via
  E-Mail:  David Bennett @ 1:280/307  or  dave@kcufgat.fidonet.org.  I'll
  see what I can do.  No support persay is provided.

  As you can tell,  this is a pretty loose 'license'.  I don't really like
  documenting this kind of stuff.  It's pretty boring work and I'd rather
  get on to the rest of my projects (and life).  This documentation is just
  typed in via my programmers editor.  If you want a hard copy then read it
  into your word processor and edit away (you might clean up my spelling
  and grammer while your at it! <grin>)

Summary:

  Usage RUC -lb -p D:\PATH -u User_Name -v Var{=NewValue} {-v ...}

  -l = listing (no write)  -p = USERS.BBS path           -b = bare mode
  -u = User's name         -v = Value to display|update  -c = User Search

  Var is : aflags=-X?         fsmsged=0,1                nokill=0,1
           ansi=0,1           fsmsgview=0,1              password=str
           avt=0,1            group=num                  pending=num
           bflags=-X?         hidden=0,1                 phone=str
           cflags=-X?         hotkeys=0,1                quiet=0,1
           clrscr=0,1         lastdate=##-##-##          screenlength=num
           credit=num         lastpwdchange=##-##-##     security=num
           dataphone=str      lastread=num               todayk=num
           deleted=0,1        lasttime=##:##             uploads=num
           dflags=-X?         location=str               uploadsk=num
           downloads=num      moreprompt=0,1             xferprior=0,1
           downloadsk=num     msgsposted=num
           elapsed=num        nocalls=num

  You may use a value of "$" as a variable value to query for user
  input (or stdin input).

Command line parameters.

  -u[User_Name]             User's name

    This is the most important command line option.  It must always be
    specifed.  It denotes the user to list values for or modify.  You
    MUST replace spaces with _'s like so:

      -uDavid_Bennett  -or-  -uRyan_P._Rehder

  -v[var]{=value -or- $}    Value to display|update  

   At least one of these command lines must be present.  This specifys
   a USERS.BBS field that you wish to edit (See the next section
   'USERS.BBS Fields' for more info).  If you just want to list
   a value you just specify the value you wish to see after the -v
   if you want to set the value to something else then you need to 
   use the -vvar=val format.  Some explanation is in order:

    -vsecurity          Just shows the users's security to the console.
    -vaflags=?X??????   Turns on the user's A2 flag leave the rest unchanged.
    -vcredit=$          Will prompt you for the users netmail credit value.
    -vansi=0            Turns off the users ansi display.
    -vnokill=1          Makes the user NO KILL so they will never be deleted.

  -l                        listing (no write)

    When this command is specified,  only a listing of all variables 
    specified (see the -v option) will be shown.  No records will
    be written.
  
  -p[path]                  USERS.BBS path
  
    Specifys the DOS path to the USERS.BBS file like -pd:\ra\
  
  -b = bare mode

    Bare mode,  when listing,  Only the actual data values will be output
    this is valuable for chaining to other programs like 'awk' that might
    do certain things based on values in USERS.BBS.

  -c = User Search

    When you specify this option RUC will search for the user and then
    exit with an errorlevel (-v options are ignored).  The error levels
    can be:

      0 ok
      1 could not find user
      2 could not open USERS.BBS
      3 command syntax error (Usage is displayed)

USERS.BBS Fields:

  These are the field values with you can specify with the -v option:
  See the code section at the bottom of this listing to describe how
  to update each variable.

  You may use a value of "$" as a variable value to query for user
  input (or stdin input) in =any= variable definition.

  Variable      Update codes    Description
  Token         (See Table      of the
  for -v        Below)          field.
  --------      -----------     ----------------------------------------

  aflags           -X?          Flag settings.  You may use '-' to turn
  bflags                        off a flag or 'X' to turn one on.  To
  cflags                        keep the same setting use '?'.  (Better
  dflags                        to see the examples section).

  security         num          Users current security level.

  fsmsged          0|1          Full Screen message editor.
  
  nokill           0|1          Never delete this user record.

  ansi             0|1          User will receive ANSI escape sequences.

  fsmsgview        0|1          Full screen message viewer

  password         str          The users password.

  avt              0|1          User will receive avatar escape sequences.

  group            num          Group number for the user

  pending          num          Pending netmail credit

  credit           num          Netmail credit left.

  hidden           0|1          Is user hidden from user list?

  phone            str          Users phone number (home phone)

  dataphone        str          Second phone (business/data phone)

  hotkeys          0|1          Does user use hotkeys (if not then stacks)

  quiet            0|1          Ignore on-line messages.

  clrscr           0|1          Clear screen codes sent.

  lastdate         date         Last date user was on-line.

  lastpwdchange    date         Last password change date.

  screenlength     num          Screen length for user.

  lastread         num          Last message read.

  todayk           num          uploads in K for today.

  deleted          0|1          Is user deleted.  (Easy to to delete a user!)

  lasttime         time         Last time user was on-line.

  uploads          num          Number of uploads from the user.

  location         str          Users location (City, state)

  uploadsk         num          Total uploads in K.

  downloads        num          Number of downloads.

  moreprompt       0|1          'More (Y/N/=)?' prompt.

  xferprior        0|1          Ignore download hours and ratios?

  downloadsk       num          Total Downloads in K.

  msgsposted       num          Number of messages posted.

  elapsed          num          Time used today.

  nocalls          num          Number of calls user has made.

  Value type codes:

    Code        Means
    ----        -----

    -X?         You may use '-' to turn off a flag or 'X' to turn one on.  
                To keep the same setting use '?'.  (See the examples section).

    0|1         Use any of "yYxX1+" to turn on, any other value to turn off.

    num         A number using the digits 0-9

    str         A string value,  this will automatically be truncated if
                too long.

    date        A date value in the format ##-##-##.  This depends on your
                RemoteAccess date type (Or QuickBBS).

    time        A time value in the format hh:mm (military)


Examples:

    RUC -l -uDavid_Bennett -vsecurity       (Displays users security settings)

    RUC -uFrank_Kennedy -vaflags=?X??????   (Turns on user flag A2)

    RUC -b -uJudy_Caronia -vansi            (Outputs just a 0 or 1 to stdout)

    RUC -c -uJoe_Taibi                      (If Joe Taibi exists, ERRORLEVEL=0)

    RUC -uMike_Reardon -vcredit=$           (Input mail credit at console)

