In some situations, it is helpful for the Adminstrator to setup and configure user accounts for the users. The first step in this process is to register the user. The AutoRegister command on the Administrator page provides this capability. There are both GUI and command line interfaces to AutoRegister.
To access the GUI interface to the AutoRegister command, login as the Administrator and go to the Admin page. Figure 9.3, “ The AutoRegister command ” illustrates the results of registering "johnson@hawaii.com" using the AutoRegister command.
The Administrator types in a user's email address, and a user key for that user is generated and an email is sent to the Administrator indicating that autoregistration has taken place. Note that no email is sent to the user: informing the user of the registration is the responsibility of the Administrator.
If the user has been previously registered, then the existing user key is returned. This is similar to the way that the normal Register command on the Hackystat server home page works. Hackystat does not create more than one user key for a given email address.
A command line interface to the AutoRegister command is also available. It's implemented as standalone Java application in the file cli.autoregister.hackystat.jar. This is located in the "downloads" directory of an installed Hackystat server. If you are reading this page from an installed Hackystat server, then you can download the file using this link.
To invoke the AutoRegister CLI, you must have Java installed. The program requires three arguments: the URL to the Hackystat home page; the administrator user key; and the email address of the user who is to be automatically registered. If autoregistration was successful, then the program returns the user key defined for the new user. Otherwise, an error message is returned if the hackystat host cannot be found, or the Admin user key is not valid, or the AutoRegister command is not installed in the configuration associated with this Hackystat server. Example 9.1, “Example Autoregister CLI invocations” illustrates several invocations of the command, illustrating different situations.
Example 9.1. Example Autoregister CLI invocations
# Example 1: Successful invocation. C:\>java -jar cli.autoregister.hackystat.jar http://localhost:8080/hackystat 8uhj56dhf8 smith@hawaii.edu User Key: Cyh8uZkpEz7t # Example 2: Unsuccessful invocation: host URL does not point to Hackystat home page. (Missing context root) C:\>java -jar cli.autoregister.hackystat.jar http://localhost:8080/ 8uhj56dhf8 smith@hawaii.edu ERROR: Unable to get a response from the Hackystat server. http://localhost:8080/controller?Key=8uhj56dhf8&Command=Autoregister&EmailTextField=smith%40hawaii.edu # Example 3: Unsuccessful invocation: bad Admin password. C:\>java -jar cli.autoregister.hackystat.jar http://localhost:8080/hackystat foo smith@hawaii.edu ERROR: Unable to get a response from the Hackystat server. Server returned HTTP response code: 500 for URL: http://localhost:8080/hackystat/controller?Key=foo&Command=Autoregister&EmailTextField=smith%40hawaii.edu # Example 4: Invoking with no arguments prints a help message and exits. C:\>java -jar cli.autoregister.hackystat.jar java -jar cli.autoregister.hackystat.jar <hackystat host> <admin key> <user email>