Change PIN Function for DRA Web2

Kerry Bouchard, 10/7/1999

This is a set of Web2 screens, a DCL CGI script, and a UDMS extract used by TCU to implement a Change PIN function in DRA Web2 running on the DRA Classic server running on VMS. The script is currently running under the CERN Web server. (I do not know what modifications might be necessary for the DECthreads web server.) The UDMS extract is quite simple, and would be easy to duplicate in GEMbase.

Because the CGI script runs Borrower_Academic_Load, and needs to be sure of correctly overlaying records, it runs BAL set to match on Student ID, rather than Name and SSAN. For various reasons, TCU loads patron records with our Student ID field set to match the ID field, so the script can be confident of getting one, and only one match on Student ID. If you do not already have Student ID fields set to unique values for all patron records, then using this technique may not work. (Since manually-entered patron records might be missing the Student ID field, the UDMS extract documented below checks that Student ID contains a value, and does not extract the patron record if it is blank; for those patrons, the script will report that it was unable to locate them in the database.)

 

COMPONENTS AND DOCUMENTATION
MyAccount.html (renamed .txt for downloading) MyAccount Web2 screen modified to include a link to a ChangePIN screen. TCU has made several other modifications to MyAccount (e.g., runs in a pop up window), so you would probably not want to copy the whole file, I'm just including it for the ChangePIN link example.
ClosePopUp.htm (renamed .txt for downloading) An HTML file outside the Web2 directory used to automatically close the MyAccount.html pop up window after a timeout. You don't need this, I'm just including it for the sake of completeness, since MyAccount.html references it.
ChangePIN.html (renamed .txt for downloading) New screen that goes in the Web2 HTML directory with the other screens. Since the patron has already validated themselves with their ID and old PIN before they get this screen, this screen just asks for the new PIN they want to use and sends it to a CGI script. (Prompts twice, so typos don't get entered.) Like MyAccount, this screen expects to be running in a pop-up window, so you might need to modify it. You will definitely need to modify the ACTION= parameter for the form to point to the server and directory where the GetPIN_2.PP CGI script is located.

If you rearrange the order of the <INPUT tags, this will break the GetPIN_2.PP script below, unless you also modify GetPIN_2.PP.
GetPIN_2.PP

DCL CGI script for changing the patron's PIN number. Checks the WWW_REFERRER_URL variable to make sure the request is coming from inside a Web2 screen where the patron has already validated themselves with their old PIN. This script was originally written to implement a "set pin" function, so only about 1/3 of it relates to changing an existing PIN. (I haven't documented the set pin function because it depends on having e-mail addresses for all/most patrons, and I don't know if that would apply to very many sites.)

The script makes the following assumptions:

  • A system-wide logical, HTBIN, is defined that points to the directory where the CERN Web server is running CGI scripts, and GetPIN_2.PP is located in this directory.
  • A system-wide logical, WWW$SCRATCH, is defined that points to a directory where the CGI script can create temporary files. (If you prefer, you could add a line near the top of GetPIN_2.PP to define this as a process-level logical.)
  • The SYSTEM account on the VMS machine running the script has the necessary DRA security to run Borrower_Academic_Load.
  • A system-wide logical, Lib$Data_Files, has been defined to point to a directory where the UDMS program below has created a file of patron information named LibPIN.IDX. If you already have a directory set up to use for files like this, then search for Lib$Data_Files in the GetPIN_2.PP script and replace it with the name of the directory you use.

Also, if you're not using pop-up windows, you'll want to delete the line that references ClosePopUp.htm. If you are using pop-up windows, you'll need to modify this line to point to the correct server.

LIBPIN.FDL FDL file called by GetPIN_2.PP to format a temp file for use with Borrower_Academic_Load. This file should be copied into the HTBIN directory.
BAL_PIN1.TXT Used by GetPIN_2.PP to create the first part of a .COM file for running Borrower_Academic_Load. If your patron database is named something other than "PATRON" you will need to modify this file. The assumes that patron records belong to system 01. This file needs to be in the HTBIN directory.
BAL_PIN2.TXT Used by GetPIN_2.PP to build the last part of the .COM file for running Borrower_Academic_Load. (Note: Since BAL_PIN2.txt says "No" to overlaying any fields except for PIN, the answers to prompts such as expiration date do not matter.) This is set to say "no" to updating the last activity counter in the patron record, so you may wish to change that and review the other responses. This file needs to be in the HTBIN directory.
BORLOAD_EXT.4GL

UDMS routine for extracting patron records in a format that can be used by BORROWER_ACADEMIC_LOAD to reload the records into the patron database. (We just use and EXT rather than a 4GL, but I don't know any way to make an EXT downloadable.) The extract includes more fields than are really needed for the ChangePIN function (the SetPIN function uses the e-mail field).

This assumes there is a view named TCU_PATRONPTTM, so you would need to modify it to use whatever UDMS view you use for reports/extracts of patron records.

LIBPIN2.FDL FDL for converting the sequential file output by BORLOAD_FORMAT.4GL to an indexed file. You might want to tune it to account for the size of your patron file.
PIN_EXTRACT.COM Fragment of DCL code used to run BORLOAD_FORMAT.4GL and convert the file. This is part of the job that runs at our site at 3am every morning, so the file gets refreshed nightly. Assumes there is a system-wide Lib$Data_Files logical pointing to the directory where the files are built and where LIBPIN2.FDL is stored, so either define this logical or modify the .COM file for your site.