From 3a31d5a2fced838a1ffd08f2999431d3fde0ead9 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 21 Jan 2011 12:26:29 -0500 Subject: added AddAccessRightNonWeb proc Ignore-this: c7910158b4748b8a0bb0150f33350075 darcs-hash:20110121172629-067c0-3138d2838ae525687972ab096f103037201c5b67.gz --- GradeBook.tcl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'GradeBook.tcl') 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 -- cgit v1.2.3