aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xGradeBook.tcl14
1 files changed, 9 insertions, 5 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index f26f2f2..3275ae8 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -1,6 +1,6 @@
#!/bin/sh
-# FILE: "/mnt/light_huge_archive/home/evmik/src/my_src/GradeBook/GradeBook.tcl"
-# LAST MODIFICATION: "Wed, 15 Dec 2010 00:33:04 -0500 (evmik)"
+# FILE: "/home/evmik/src/my_src/GradeBook/GradeBook.tcl"
+# LAST MODIFICATION: "Wed, 15 Dec 2010 09:58:11 -0500 (evmik)"
# (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
# $Id:$
# vim:set ft=tcl: \
@@ -26,8 +26,8 @@ set action [::ncgi::value action none]
if { [catch {set script_name $env(SCRIPT_NAME)} errStat] } { set script_name unknown}
-#set val [::ncgi::value fd]
+# ########################## procs begin #################################
proc dbg {msg {level 1}} {
if { $level <=2 } {
set fid [open log a+]
@@ -188,13 +188,14 @@ proc ChoseAction {action permission_list} {
dbg "requested action: $action" 3
switch $action {
sort {
- if { $permission(logoff) } { LogMeOff }
+ if { $permission(sort) } { SetSortColumn }
}
default { }
}
}
proc AccessGroupRights {db user password } {
+ dbg "access rights check for user: $user"
if { $user == "guest"} {
set group guest
} else {
@@ -203,11 +204,13 @@ proc AccessGroupRights {db user password } {
set eval_str [list SELECT * FROM AccessRightsTable WHERE GroupName == '$group']
db eval $eval_str permissions {}
array unset permissions {\*}
- dbg "permissions are: [array get permissions]"
+ dbg "permissions for user $user are: [array get permissions]"
return [array get permissions]
}
##################### end of procs ####################################
+set timestamp [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S"]
+
#CreateGradesTable db
#CreateAccessRightsTable db
dbg [::ncgi::names] 4
@@ -215,6 +218,7 @@ dbg [::ncgi::names] 4
if { $action == "logon" } { LogMeOn }
if { $action == "logoff" } { LogMeOff }
+dbg "Connection at $timestamp for user $user"
set permissions [AccessGroupRights db $user $password]
ChoseAction $action $permissions