aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xGradeBook.tcl26
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