aboutsummaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-01-21 12:26:29 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-01-21 12:26:29 -0500
commit3a31d5a2fced838a1ffd08f2999431d3fde0ead9 (patch)
treeea764be78bc48b50e37161014fb325b31d62af4a /GradeBook.tcl
parent52c4be7309cf55346c950890e1c11d2781f5f4fc (diff)
downloadGradeBook-3a31d5a2fced838a1ffd08f2999431d3fde0ead9.tar.gz
GradeBook-3a31d5a2fced838a1ffd08f2999431d3fde0ead9.zip
added AddAccessRightNonWeb proc
Ignore-this: c7910158b4748b8a0bb0150f33350075 darcs-hash:20110121172629-067c0-3138d2838ae525687972ab096f103037201c5b67.gz
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl9
1 files changed, 9 insertions, 0 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index bcf4606..622704a 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -80,6 +80,15 @@ proc CreateGradesTable {db} {
AddUserNonWeb Jon "Jonovich" jon [::md5::md5 -hex qwerty] student
}
+proc AddAccessRightNonWeb { action instructor_right ta_right student_right guest_right } {
+ set eval_str [concat INSERT INTO AccessRightsTable (actionname, instructor, ta, student, guest) VALUES('$action', '$instructor_right', '$ta_right', '$student_right', '$guest_right')]
+ set err [catch {db eval $eval_str } errStat]
+ if { $err } {
+ htmlErrorMsg $errStat
+ dbg "the following error happen: $errStat" 3
+ }
+}
+
proc CreateAccessRightsTable {db} {
db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student integer, guest integer)}
# guest should have no rights make sure that 0 is evereywhere