From 07019ca4cf3aa7cb7cff6216f1955deb098bc5a9 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Tue, 25 Jan 2011 10:25:02 -0500 Subject: added new user web code Ignore-this: a2428f982396ff4ee385e8c1bb90e78f darcs-hash:20110125152502-067c0-dedc208c17fb1501834a4a4e9ed0bd8f408ffd0d.gz --- GradeBook_lib.tcl | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 21b89ea..d65a33f 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -134,6 +134,8 @@ proc CreateAccessRightsTable {db} { AddAccessRightNonWeb userunhidegroup 1 0 0 0 AddAccessRightNonWeb editcourseinfo 1 0 0 0 AddAccessRightNonWeb updatecourseinfo 1 0 0 0 + AddAccessRightNonWeb editnewuserinfo 1 0 0 0 + AddAccessRightNonWeb addnewuserinfo 1 0 0 0 } proc htmlErrorMsg { msg } { @@ -434,6 +436,9 @@ proc ChoseAction {action permission_list user} { editcourseinfo { EditCourseInfo db $permission_list $user } updatecourseinfo { UpdateCourseInfo db $permission_list $user htmlDefaultView $permission_list $user } + editnewuserinfo { EditNewUserInfo db $permission_list $user } + addnewuserinfo { AddNewUserInfo db $permission_list $user + htmlDefaultView $permission_list $user } defaultview { htmlDefaultView $permission_list $user } default { htmlErrorMsg "requested action $action is granted but not implemented yet" } } @@ -443,6 +448,41 @@ proc ChoseAction {action permission_list user} { } } +proc AddNewUserInfo {db permission_list user } { + set subaction [::ncgi::value subaction {}] + set first_name [::ncgi::value first_name {}] + set last_name [::ncgi::value last_name {}] + set login [::ncgi::value login {}] + set id_number [::ncgi::value id_number {}] + set section_number [::ncgi::value section_number {}] + set group_name [::ncgi::value group_name {}] + + if { $subaction eq "Cancel" } { + return + } + if { $subaction eq "Submit" } { + AddUserNonWeb $first_name $last_name $login {} $group_name $id_number $section_number + } +} + +proc EditNewUserInfo {db permission_list user } { + global script_name + + puts "
" + puts "
" + puts "First Name:
" + puts "Last Name:
" + puts "Login:
" + puts "Id Number:
" + puts "Section Number:
" + puts "Group Name:
" + puts {} + puts {} + puts {} + puts {
} + puts "
" +} + proc EditCourseInfo {db permission_list user } { global script_name set CourseTitle [SelectItemFromCourseInfoTable course_title] @@ -814,7 +854,7 @@ proc ShowControls { permission_list user } { global script_name dbg "outputing contol list" puts "
" - set action_list [ list defaultview "Refresh" addcolumnrequest "Add Column" logoff "Logoff" editcourseinfo "Edit Course Info"] + set action_list [ list defaultview "Refresh" addcolumnrequest "Add Column" logoff "Logoff" editcourseinfo "Edit Course Info" editnewuserinfo "Add new user"] set separator { } foreach {act act_label} $action_list { if { [isActionGranted $act $permission_list $user] } { -- cgit v1.2.3