Telnet-Accessible Client For Drink

This is the manual for the Telnet-Accessible Client for Drink.
The client was developed by Kevin Thompson [antiduh@csh.rit.edu].

Index

Top Of Document
    Basic Usage
    Basic Client Features
    Hostnames
    Full View of Client
Feature Breakdown
    Logon Screen
    Client Main Screen
    Client Commands
        List (command L)
        Drop (command D)
        Drop Random (command R)
        Quit (command Q)
        Administrative Commands
            Add Credits (command E)
            Edit Can Count (command  S)
            User Administration (command A), body
                Add User (command A)
                Remove User (command R)
                Set Administrator flag (command S)
                View Administrator flag status (command C)
                Query User Balance (command B)
                Add Credits (command E)
                Valid-User Query (command V)
            Edit Entire Slot (command O)
           

Basic usage

To use the client, log into one of the drink machines by typing:
telnet <machine> 42

Where <machine> refers to either drink machine. Please see the section labeled ‘Hostnames’.

NOTE: If you forget to enter the port number 42, you will be connected to that machines local telnet port. In the case of Big Drink, this will connect you to the telnet administration interface for the TINI microprocessor. If you happen to accidentally do this, type control-] (the escape character) and you will be brought to your telnet client's escape prompt. Then type quit.

Basic Client features

Default Prompt Values: Prompts that have values in [brackets] represent a default action or value. Hitting enter on the prompt, without entering a value, selects the default action or value.
Prompts that do not have a default value will simply abort if there is no supplied value.

Example:

drink > d
Slot to drop [enter to abort]:
Aborting drop

Control-U (^U): Just like in most command shells, you may use control-u to erase the current line. This works throughout the entire client, even on the password field of the login prompt (even though you may not see it). 

Drink Machine Hostnames

Current, there are two drink machines on CSH's floor. Big Drink (also known as just 'Drink') and Little Drink. Both machines each have two hostnames: Big drink has drink.csh.rit.edu and d.csh.rit.edu. Little drink has littledrink.csh.rit.edu and ld.csh.rit.edu

The smaller hostnames are provided for simplicity. They were provided because the machines are connected to commonly from CSH's own network, and thus just the machine name could be used to connect. 

For example:
fury(~) > telnet d 42

Will connect you to Big Drink’s telnet client if you are on CSH’s network, or logged into a CSH machine.

Full View of Client

When you connect to a machine, you will see a screen similar to the following:

Welcome to drink! 
Running client v1.23 last updated 18-May-2003.
Username: antiduh
Password: 
Authenticating...done

Current drink temperature: 107.6F, 42.0C

SLOT   DRINK            COST  # LEFT    # SOLD
-----------------------------------------------
 0      Yoohoo           50      45       311
 1      Cherry Coke      50      50       115
 2      Coke             50      21       191
 3      Dr. Pepper       50      50       206
 4      Barqs            40      1        2
 5      IBC Rootbeer     50      0        96
 6      Jolt             60      35       101
-----------------------------------------------

You have 650 credits remaining

Commands (case-insensitive): 
[ L   List machine Contents ]-[ E   Add credits        ]
[ D   Drop a drink          ]-[ A   Goto user admin... ]
[ R   Drop a random drink   ]-[ S   Update can count   ]
[ Q   Quit                  ]-[ O   Edit entire slot   ]
                              [ C   Add log comment    ]
drink >

At first, you will only see a login prompt. Enter your CSH username and  password. Make sure your telnet client’s local echo is turned off, otherwise your password will show. Most clients should auto-negotiate echoing, unless you have local echo completely forced on.
Commands shown above in bold are available to administrators only.

Feature Breakdown

Logon screen

corrugated(~) > telnet fake-drink 42
Welcome to drink!
Running client v1.23 last updated 18-May-2003.
Username:

This is the logon screen. If this is your first time logging into drink, your account will be created with default values. You will not have administrative privileges and your balance will be zero.

Blank Input: If you hit ‘return’ at an empty prompt for either the username or password, the program will cycle back to asking for the username. This is useful if you mistype your username - simply hit enter twice and you’ll be prompted for your username again. This is also useful if you are used to systems where you need to hit enter for a prompt to appear.
However, if the field is non-empty, then the program will interpret that as a valid entry.

Maximum Attempts/Password Validation: You may only enter a username/password pair three times before you are kicked from the client. If you enter an invalid password for any attempt, the client will pause for a short time before allowing you to enter your username again. Both of these features are provided to prevent brute-forcing of a user’s password.

Password entry: Passwords are not echoed back to the client. This is for security, so that someone peering over your shoulder does not see your password, nor does it show up in any buffer or command history. NOTE: If your telnet client forces local echo, YOUR PASSWORD WILL BE VISIBLE. This is beyond the control of the drink client.

Client Main Screen:
Current drink temperature: 107.6F, 42.0C

SLOT   DRINK            COST  # LEFT    # SOLD
-----------------------------------------------
 0      Yoohoo           50      45       311
 1      Cherry Coke      50      50       115
 2      Coke             50      21       191
 3      Dr. Pepper       50      50       206
 4      Barqs            40      1        2
 5      IBC Rootbeer     50      0        96
 6      Jolt             60      35       101
-----------------------------------------------

You have 650 credits remaining

Commands (case-insensitive): 
[ L   List machine Contents ]-[ E   Add credits        ]
[ D   Drop a drink          ]-[ A   Goto user admin... ]
[ R   Drop a random drink   ]-[ S   Update can count   ]
[ Q   Quit                  ]-[ O   Edit entire slot   ]
                              [ C   Add log comment    ]
drink >
This is the screen you will see once you have logged in. 
Commands shown above in bold, on the right-hand-side, are administrator commands only. You will not see these commands unless you are an administrator.

Temperature Readout: Shows the temperature of the soda cabinet. This feature only works on Big Drink.

Beverage Listing: A listing of all available beverages. The ‘ # Left ‘ column specifies the number of cans left in that slot. The ‘ # Sold ‘ column shows the number of cans sold since the counter was last reset.

Client Commands:

Commands are not case-sensitive.

Command L (List Beverages)
Redisplays the beverage listing. If you are an administrator, this is useful for confirming an update.

Command D (Drop Drink)
Prompts the user for which slot to drop a beverage, and the delay to wait before dropping. The delay is useful so that nobody will steal your drink while you are walking to get it.

drink > d
Slot to drop [enter to abort]: 2
Delay (0-60)[0]: 10

If you don’t mean to drop a drink, hit enter to abort the operation.
The delay may only be up to one minute, to prevent a person from hogging all connection channels.
Note that the user will be automatically disconnected from the client after their drink has been dropped.

Command R (Drop Random):
Drops a random beverage. The user will only be prompted for a delay.

drink > r
Delay (0-60) [0]: 0
Connection closed by foreign host.

Command Q (Quit Client):
This should exit the client. This is the only command for which you may enter more than just ‘q’. For instance, some users have a habit of entering ‘quit’, which would still exit the client.

Administrative Commands:

These are commands that will only be available to the administrator. Regular users will not see these commands.

Command E (Add Credits):
This will prompt the administrator to add credits to a users account:

drink > e
User: antiduh
Credits to add: 10
Successfully added 10 credits to antiduh's account

If the user does not exist, the administrator will be prompted to register the user with the Drink system.

Command A (User Administration):
This enters the administrator into the user administration sub-menu. This sub-menu will be discussed below.

Command S (Update Slot Quantity):
Updates the number of cans left in a single slot. This is useful after restocking a slot, so that all the slot data doesn’t need to be re-entered.

drink > s
Which slot do you wish to edit? : 0
Enter new quantity for 'Yoohoo': 20
Operation successful
The name of the slot will be printed in the new quantity prompt, so that the admin may verify that they selected the correct slot.
Entering a blank value (by simply hitting ‘return’) for either prompt will abort the procedure.

Command O (Edit Entire Slot):
This command will allow the user to change every value for a single slot. The current values are used as the default values for the operation. This way, if the user wishes to simply edit the price of the slot, then the user can hit enter for all the other commands (to use the default), and enter a value for just the price:
drink > o
Which slot do you wish to edit? : 0
Enter name [Yoohoo]:
Enter cost [50]:
Enter quantity [20]:
Enter # dropped [311]:
Enabled? [true]: false
Operation successful

Here, the first slot (‘Yoohoo’) was simply disabled.

User Administration

This section covers the sub-menu which may be accessed by executing command ‘A’ on the prompt. This loads the "User Administration" submenu.

drink > a
[ A Add user ]
[ R Remove user ]
[ S Set/unset admin ]
[ C Check if user is admin ]
[ B Display user balance ]
[ E Add to user balance ]
[ V Determine if valid user ]
[ Q Go back to the main menu ]
drink::user_admin >

Command A (Add User):
Adds a user to the list of known user. The username of the user must match a valid CSH user.

drink::user_admin > a
Username: blarg
Password for the new user:
Successfully added blarg

The command will prompt for the users password; This is future-proofing in the case that the drink accounting subsystem were to switch to drink-specific passwords.
The password must not be blank.
The user’s account will be created with default values - their balance will be zero, and their admin flag will be set to false.
If either field is blank, or if the user is already registered, the operation will abort.

Command R (Remove User):
Removes a user from the list of registered users.

drink::user_admin > r
Username: blarg
Successfully removed blarg

If the username field is blank or the user is not already registered, the operation will abort.

Command S (Set Admin flag):
Changes the status of a users administrator flag. This may be used to grant or revoke administrator status.

drink::user_admin > s
Username: blarg
Admin status (t/f) [f]: t
Operation successful

The operation will abort if the username is empty.
If the status flag is not ‘t’ or ‘f’ or empty (which selects the default, ‘f’), then the operation will abort.

Command C (Query Admin Status):
Shows the administrator status of a given user.

drink::user_admin > c
Username: antiduh
User antiduh is an administrator

The given username must be a valid username, otherwise the operation will abort.

Command B (Query User Balance):
Shows the given users credit balance.

drink::user_admin > b
Username: antiduh
Balance for antiduh: 660

If the user entered is not a valid user, then the operation will abort.

Command E (Add Credits):
Adds credits to a given users credit balance.

drink::user_admin > e
User: antiduh
Credits: 0
Operation successful

Note that this does not set the users credit balance, but that the credit parameter is a credit delta and may be positive or negative. By supplying a value of -25, 25 credits are removed from the users balance.
If either the supplied username or credit delta is blank, then the operation will abort.

Command V (Valid user):
Displays whether or not the given user is registered with the system.

drink::user_admin > v
Username: antiduh
User antiduh is a valid user

If the given username is blank, then the operation will abort.

This document is maintained by Kevin Thompson, [antiduh@csh.rit.edu].
Last Revised: $Date: 2003/08/10 $