diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-15 09:58:13 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2010-12-15 09:58:13 -0500 |
commit | fda53373c10d59534e2ff28c334e35f011d464b9 (patch) | |
tree | da75ef463fb2ff26782df71814612021e69a0682 /GradeBook.tcl | |
parent | 6a84f46222a534390e885c06fd19be889e6b74af (diff) | |
download | GradeBook-fda53373c10d59534e2ff28c334e35f011d464b9.tar.gz GradeBook-fda53373c10d59534e2ff28c334e35f011d464b9.zip |
time stamp and sort permission check fix
darcs-hash:20101215145813-067c0-d7f31cb63bca37c2cfa43fe62c7d662b4c969368.gz
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 14 |
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 |