From a33e4ddc7c9cd95eae97ef4df93f0d1b5c278894 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 20 Jan 2011 23:48:17 -0500 Subject: Not using PasswordsTable anymore, everything in GradesTable now Ignore-this: b84a98f6c3bc68e5358ac97dabf825ba darcs-hash:20110121044817-067c0-884f1cb9d1f30aefc92343cf98b78399c81e6e35.gz --- GradeBook.tcl | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'GradeBook.tcl') diff --git a/GradeBook.tcl b/GradeBook.tcl index 07d9154..2b8984a 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -44,21 +44,6 @@ set dbfile "./testdb" sqlite3 db $dbfile -proc CreatePasswordsTable {db} { - db eval {CREATE TABLE PasswordsTable(UserName text, PasswordHash text, GroupName text)} - set eval_str [list INSERT INTO PasswordsTable VALUES('instructor', '[::md5::md5 -hex qwerty]', 'instructor')] - db eval $eval_str - set eval_str [list INSERT INTO PasswordsTable VALUES('ta', '[::md5::md5 -hex qwerty]', 'ta')] - db eval $eval_str - - set eval_str [list INSERT INTO PasswordsTable VALUES('jhn', '[::md5::md5 -hex qwerty]', 'student')] - db eval $eval_str - set eval_str [list INSERT INTO PasswordsTable VALUES('ale', '[::md5::md5 -hex qwerty]', 'student')] - db eval $eval_str - set eval_str [list INSERT INTO PasswordsTable VALUES('dan', '[::md5::md5 -hex qwerty]', 'student')] - db eval $eval_str -} - proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {guest}} } { set eval_str [concat INSERT INTO GradesTable (FirstName, LastName, UserName, PasswordHash, GroupName) VALUES('$first_name', '$last_name', '$user_name', '$password_hash', '$group_name')] set err [catch {db eval $eval_str } errStat] @@ -711,7 +696,7 @@ proc ShowControls { permission_list user } { proc AccessGroupRights {db user password } { dbg "access rights check for user: $user" set PasswordHash [::md5::md5 -hex $password] - set eval_str [list SELECT GroupName FROM PasswordsTable WHERE UserName='$user' AND PasswordHash='$PasswordHash'] + set eval_str [list SELECT GroupName FROM GradesTable WHERE UserName='$user' AND PasswordHash='$PasswordHash'] db eval $eval_str group_name_array {} if { [ info exist group_name_array(GroupName) ] } { set group $group_name_array(GroupName); @@ -811,7 +796,6 @@ puts { set timestamp [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S"] -#CreatePasswordsTable db #CreateGradesTable db #CreateAccessRightsTable db dbg [::ncgi::names] 4 -- cgit v1.2.3