The purpose of the UserInfo component is to automatically determine the logon name of the browser user and send it to the server. This lets borrowers request library books without having to type in passwords.
Note Instead of creating and using a custom COM component, it would have been possible to force the browser to authenticate each user who wants to request library items. The problem with relying on this is that each operating system handles the task differently. Windows NT® automatically logs in and sends the password to the server using a fairly secure method. On the other hand, Windows 95 prompts the user for a password and sends it to the server in nearly plain text, which presents what the CML designers felt to be too high a security risk.
The library user's logon name is necessary because the CML uses the identities of requesters of library items to notify them of request results, to enable delivery of requested items, and if necessary to send overdue notices. Designers of the CML felt that requesting items should need minimal user input. In other words, you should not need to enter your name each time you want to check out a book. This is why UserInfo obtains its information automatically.
UserInfo uses Win32® API calls to retrieve information about the current user. Those API calls are wrapped into the following Visual Basic functions, which are declared in the (General) section of UserInfo's Module 1:
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Declare Function GetLastError Lib "kernel32.lib" () As Long
The first function declared here, GetUserName, makes a call implemented in the Win32 advapi32.dll on the client computer to retrieve the current user name. This function is called within UserInfo's Logon Get property. The other API function, GetComputerName, is used in UserInfo's ComputerName Get property. The UserInfo component displays no user interface; it simply retrieves information and sends it to the server.
The CML application complies in the following ways with the Win32 requirement of the Designed for Microsoft BackOffice Logo Program: