diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-20 23:48:17 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-20 23:48:17 -0500 |
commit | a33e4ddc7c9cd95eae97ef4df93f0d1b5c278894 (patch) | |
tree | 5d3cd32c80bf0b7b6d849c8a2d97e9e9a17c8c32 | |
parent | 673ba00001d4d6e9f894de94be65d48844d75e87 (diff) | |
download | GradeBook-a33e4ddc7c9cd95eae97ef4df93f0d1b5c278894.tar.gz GradeBook-a33e4ddc7c9cd95eae97ef4df93f0d1b5c278894.zip |
Not using PasswordsTable anymore, everything in GradesTable now
Ignore-this: b84a98f6c3bc68e5358ac97dabf825ba
darcs-hash:20110121044817-067c0-884f1cb9d1f30aefc92343cf98b78399c81e6e35.gz
-rwxr-xr-x | GradeBook.tcl | 18 |
1 files changed, 1 insertions, 17 deletions
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 |