# This is an -*- indented-text -*- document.
#
# file: TODO
# a list of things to do for the school roster project.
#
# Copyright (c) 1997 by Jim Lynch.
# This software comes with NO WARRANTY WHATSOEVER.
#
# This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; version 2 dated June, 1991, or, at
#    your option, any LATER version.
# 
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
# 
#    You should have received a copy of the GNU General Public License
#    along with this program;  if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA.
# 
# On Debian Linux systems, the complete text of the GNU General
# Public License can be found in `/usr/doc/copyright/GPL'.

- Convert roster records to objects -done

- convert users records to objects -done
   - merge: -------------------------------------------- works
       - new student works
       - current student adding classes works
       - drop from class works
       - drop from all classes works
       - add logging for records-missing-from-upstream-database: ready to test
   - functions.perl: probably done (was done at the same time as merge)

   - mk-logins.perl: ----------------------------------- works
   - stdin-mk-teacher-db.perl: ------------------------- works
   - stdin-userlist.perl: ------------------------------ works
   - stdin.users.db2pass.txt.perl: --------------------- works
   - remove-server-entries.perl: ----------------------- works
   - correct-groups.perl: ------------------------------ works

   - del-all-nt.perl: ---------------------------------- works
   - exp-date-nt.perl: --------------------------------- works
   - novell-del.perl: ---------------------------------- works
   - unix-del.perl: ------------------------------------ works

   - get-records-by-code.perl: ------------------------- unchanged
   - regen-passwd-from-shadow.perl: -------------------- no change
   - sched.perl: --------------------------------------- no change
   - scramble.perl: ------------------------------------ no change
   - stdin-mail-teacher-databases.perl: ---------------- no change
   - mail-teacher-databases.perl: ---------------------- unchanged
   - mk-all-class-printouts.perl: ---------------------- unchanged
   - mk-all-teacher-dbs.perl: -------------------------- unchanged
   - paths.perl: --------------------------------------- no change
   - process-new-rost.bash: ---------------------------- no change
   - mk-class-printout.perl: --------------------------- unchanged
   - mk-code-file.perl: -------------------------------- unchanged
   - mk-code-list.perl: -------------------------------- unchanged
   - mk-groups.perl: ----------------------------------- unchanged
   - mk-master-db.perl: -------------------------------- no change
   - mk-master-printout.perl: -------------------------- no change
   - mk-teacher-db.perl: ------------------------------- no change

- Propigate class droppings to database and to servers -- done

  + create script that adds specific class account add times to
    server description for each user -- DONE: convert-users.perl

  + Modify the pack and extract functions in functions.perl so they
    deal with the specific class group data -- DONE

  + alter merge-cis_rost.db-users.db.perl if necessary to make sure it
    actually drops students from groups that are not present in
    the download from the main school computer. -- DONE

    also, handle the case in which no school district records exist for
    a student we (used to) know about by keeping the record and removing
    all class references. mk-logins.perl should respond by disabling
    that student's account on all servers. -- DONE

  + add class drop function to server-funcs.perl
      -- done

  + add account remove function to server-funcs.perl
      -- done

  + add account disable function to server-funcs.perl
      -- done

  + adjust the server-types database to reflect the changes made to 
    server-funcs.perl -- done

  + alter LoadServerTypes() and LoadServers() (in functions.perl) to 
    adjust for changes to server-funcs.perl (i.e., change in server types
    data structure) -- done

  + alter mk-logins.perl so it takes the specific class group data into
    account, and alters it as appropriate -- done

- make servers and server-types into perl-oop packages with a base-class
  generic server type that has fall-through functions in case/while appropriate
  methods are not overridden in specific server type packages -done

- Generalize dept name! (now, we are specific to CIS dept) NEW!! -done!

- add school name NEW!! -done!

- add account expiration dates to the classes database

- need to create the mass-student-deleter scripts

- unix user numbers should be assigned and kept track of in
  the database. - done

- Put user documentation for correct-groups.perl and
  regen-novell-logins.perl into the README file

- put user documentation for userlist.perl and get-records-by-code.perl
  into README (note: get-records-by-code.perl replaced by
  get-records-by-class-id.perl)

- alter the database structure to accommodate multiple machines and
  account types. For example, have separately managed passwords on
  two unix servers altho they're the same machine type; include NT
  and novell servers as well, and make sure that we can do things like
  have 3 novell servers, 2 nt servers and 4 unix servers.
    -- done

  As far as the main database is concerned, these server records should
  appear to be in a single field which would be extracted into an array.
  
  For each server a student is to have access to, the database should
  contain:
  - a unique identifier naming the server
  - password
  - date and time the login for this server was generated
  - a hash containing optional values for a particular machine type:
      for a unix machine, user number to keep track of backups and owned files

  Second, there will be a database relating the actual machines to
  their type. So, the fields are:
  - server identifier
  - server type identifier
  - Optionally, a list of static key/value pairs meant for the ExtraInfo
    field, for this server
  - Optionally, a list of groups whose members should have accounts created
    on this server. If the list is empty, add all students. (NOTE: this would
    conceivably allow all four groups (students, faculty, staff, system) to
    be represented using the Users data structure)

  Then, there should be a database of server types keyed on a unique 
  ID, and would contain:
  o server type identifier
  o procedure identifiers:
    o initialize server login files
    o add one more login for this server, given the database record
    o close server login files
    o use a description of the extra info needed for a particular machine
      to form the list of keys and values (and how to make certain values on
      the fly if applicable) which would go into the password management
      record for this server of a given user
        (NOTE that this would allow for including a unix user ID, as 
        well as selecting the method of categorizing groups of user IDs: 
        for example in the present scheme, there are students, faculty, 
        staff and system ranges of IDs. If we are allowed to specify how
        a key/value pair is made on the fly, then we can arrange to choose
        ID ranges other than for students.)
  o Optionally, a list of static key/value pairs meant for the ExtraInfo
    field, for this server type

  This is now being worked on, as follows: (actually, all done)

  Delete the hardwired laney-net1 and earth machine descriptions
  from the users database, and replace it with the following generalized
  data structure:

  $users->{ServersData}->{$whichServer}->{Passwd} = cleartext passwd
                                       ->{TimeLoginMade} = secs since 1/1/70
                                       ->{ExtraInfo}->{$aKey1} = $aVal1
                                                    ->{$aKey2} = $aVal2
                                                    :
                                                    :

  (note, each server also has a list of classes and timestamps of when student
  account on that server was modified to include that class)

  which corresponds to a textual structure in $users->{Servers}, which
  looks like

  $whichServer/Passwd/TimeLoginMade/$aKey1=$aVal1+$aKey2=aVal2....

  next to do:
    o Create an infrastructure in the "data" directory
       which would be used to create and use the above
       data structure to support multiple machines
       (See: "database of servers", above) -- DONE: "servers" and "serverTypes"

    o Modify PackUsersRecordFromHash to use the above data structure
        We "copped out": we expect the text representation in 
        $users->{Servers}, and we are creating a fn called
        PackServersData which takes the data structure and 
        turns it into text.

    o Also do mk-logins.perl; when done, find others to do and list them here

  NOTE: THIS IS ALL DONE

- update the database merge program and make sure it works - done

- make sure the database's initial login names only contain letters - done

- write the filters that output the account-creating files - done

- while working on the program, make sure that each program is documented,
  both for its overall function (right after the copyright message), and 
  also at least every few lines, if not every line to convey the steps
  and their meaning wrt the database
  + done for:
    - cis_rost.txt2cis_rost.db.perl
    - merge-cis_rost.db-users.db.perl
    - partially did functions.perl

- update readme and todo list

- make sure teacher printouts:
  + are sorted by the full name -- done
  + display the full name and student ID code - done
  + show that the password applies to all server types -- is this needed??
  + display the email address
  + output an even number of pages - done
  + have a header at the top that shows the range
    of students on that page, like a phone book - done
  + outputs in multicolumn, like ls -C. - done

- update readme and todo list

- update the programs to actually output to filenames,
  instead of having to redirect
  - Done for:
    + classes.tab2codegroup.colon.perl
    + cis_rost.txt2cis_rost.db.perl
    + merge-cis_rost.db-users.db.perl
    + mk-logins.perl

- update readme and todo list

- merge should automatically create a temporary file for the merge
  output, then overwrite the old database with the new one when done
  - Done

- there should be a way to name databases for the term and have
  all the programs use the correct names, instead of them being
  hardwired, for example right now "usersm97.*" is pretty much
  hardwired into the code. Come up with an alternative.
  + DONE: put the term into a file called term.txt piled in with
          everything else.
  
- update readme and todo list

- come up with a neater directory structure than just "pile all scripts
  and data files into the same dir". -- done: data goes into new dir "data"
  which is pointed at by a line in paths.perl.