diff options
-rwxr-xr-x | GradeBook_lib.tcl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index afb2d46..238bb17 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -466,7 +466,23 @@ proc AddNewUserInfo {db permission_list user } { if { $subaction eq "Cancel" } { return } + + if { $login eq "" } { + htmlErrorMsg "Empty login names are not permitted" + return + } + + if { [SelectColValue4User UserName $login] ne "" } { + htmlErrorMsg "User with login $login already exists" + return + } + + set permitted_groups [list instructor ta student guest] if { $subaction eq "Submit" } { + if { $group_name ni $permitted_groups } { + htmlInfoMsg "Unknown group name {$group_name} replaced with {guest}." + set group_name guest + } AddUserNonWeb $first_name $last_name $login {} $group_name $id_number $section_number } } @@ -478,7 +494,7 @@ proc EditNewUserInfo {db permission_list user } { puts "<form name=\"input\" action=\"$script_name\" method=\"post\" />" puts "First Name: <input type=\"text\" name=\"first_name\" ><br>" puts "Last Name: <input type=\"text\" name=\"last_name\" ><br>" - puts "Login: <input type=\"text\" name=\"login\" ><br>" + puts "Login (email): <input type=\"text\" name=\"login\" ><br>" puts "Id Number: <input type=\"text\" name=\"id_number\" ><br>" puts "Section Number: <input type=\"text\" name=\"section_number\" ><br>" puts "Group Name: <input type=\"text\" name=\"group_name\" ><br>" |