diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-16 12:24:42 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-16 12:24:42 -0500 |
commit | 7eb1d0db572671126d682f5323fc24d8b6be79af (patch) | |
tree | 285de2d9031a2f670f43653c1db2a10ca23f39ab /GradeBook.tcl | |
parent | 7b50177e793d3240560167600d903e6ce1ec0d6d (diff) | |
download | GradeBook-7eb1d0db572671126d682f5323fc24d8b6be79af.tar.gz GradeBook-7eb1d0db572671126d682f5323fc24d8b6be79af.zip |
everything is done through action call
darcs-hash:20101216172442-067c0-4fe4f7edc20b101452cf1cfb72f5efe9fa77b267.gz
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index dac6250..9f9c098 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -1,6 +1,6 @@ #!/bin/sh -# FILE: "/home/evmik/src/my_src/GradeBook/GradeBook.tcl" -# LAST MODIFICATION: "Wed, 15 Dec 2010 20:19:00 -0500 (evmik)" +# FILE: "/mnt/light_huge_archive/home/evmik/src/my_src/GradeBook/GradeBook.tcl" +# LAST MODIFICATION: "Thu, 16 Dec 2010 12:23:15 -0500 (evmik)" # (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com> # $Id:$ # vim:set ft=tcl: \ @@ -214,14 +214,15 @@ proc SetSortColumn {} { ::ncgi::setCookie -name sortCol -value $sortCol } -proc ChoseAction {action permission_list} { +proc ChoseAction {action permission_list user} { array set permission $permission_list dbg "requested action: $action" 3 switch $action { - sort { - if { $permission(sort) } { SetSortColumn } - } - default { } + sort { if { $permission(sort) } { SetSortColumn; ChoseAction {} $permission_list $user } } + addcolumn { if { $permission(addcolumn) } { } } + deletecolumn { if { $permission(deletecolumn) } { } } + renamecolumn { if { $permission(renamecolumn) } { } } + default { htmlGradesTable db $permission_list $user } } } @@ -284,8 +285,9 @@ proc htmlStudentGrades { db user } { } -proc htmlGradesTable {db permission_list sortCol user} { +proc htmlGradesTable {db permission_list user} { array set permission $permission_list + global sortCol switch $permission(GroupName) { guest { } student { htmlStudentGrades db $user} @@ -308,12 +310,12 @@ if { $action == "logon" } { LogMeOn } if { $action == "logoff" } { LogMeOff } dbg "===== Connection at $timestamp for user $user =====" -set permissions [AccessGroupRights db $user $password] +set permission_list [AccessGroupRights db $user $password] ::ncgi::header -ChoseAction $action $permissions -htmlTop $permissions -htmlGradesTable db $permissions $sortCol $user +htmlTop $permission_list +ChoseAction $action $permission_list $user +#htmlGradesTable db $permission_list $user #htmlDBout db $sortCol |