aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xGradeBook.tcl18
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