Index: branches/LCSv2/controllers/default.py
===================================================================
--- branches/LCSv2/controllers/default.py	(revision 622)
+++ branches/LCSv2/controllers/default.py	(revision 623)
@@ -3,8 +3,14 @@
 hwys = ['','1','5', '22', '55', '57', '73', '74', '91', '133', '142', '241', '261', '405', '605']
 hwyDirections = ['','NB', 'SB', 'NB/SB','EB','WB','EB/WB']
+# Names to appeaer in the username dropdown box
+users = []
 # Show the login page
 def index():
-    form = FORM(LABEL('Username:',_for='username', _class="label username-label"),
-                INPUT(_name='username', _size='15', _style="font-size: 18px;"), BR(),
+    userfile = open('student_names.txt','r')
+    users = [line.strip() for line in userfile.readlines()]
+    users.insert(0,'')
+    form = FORM(LABEL('User:',_for='username', _class="label username-label"),
+                #INPUT(_name='username', _size='15', _style="font-size: 18px;"), BR(),
+                SELECT(users,_name='username',requires=IS_LENGTH(minsize=1,error_message='Must select a user from the list.')),BR(),
                 INPUT(_type='submit',_value="Log in", _class=" btn btn-primary", _style="margin-top: 3%;"))
     if form.process().accepted:
@@ -298,6 +304,7 @@
 # Calculate the closure id to assign to the new closure
 def calcNextClosureID(routeNum):
-    # Retrieve any existing closures on this route
-    item = db(db.closures.closureid.startswith('T'+routeNum)).select().last() # Might need to sort these
+    # Retrieve the last existing closure on this route
+    #item = db(db.closures.closureid.startswith('T'+routeNum)).select().last() # defective
+    item = db(db.closures.route == routeNum).select().last() 
     if (item != None):
         currID = item.closureid
