diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-01-21 20:49:07 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-01-21 21:20:36 -0500 |
commit | 45deaf194d3e010277b11cb1d203b2fec4e10426 (patch) | |
tree | 04acef46956b022e3b711b285eaa03f5aa7943e6 /GradeBook_lib.tcl | |
parent | 10549d3ef4d24e6059840ff6ed3c52bbe2f3add1 (diff) | |
download | GradeBook-45deaf194d3e010277b11cb1d203b2fec4e10426.tar.gz GradeBook-45deaf194d3e010277b11cb1d203b2fec4e10426.zip |
Password hash is not required to create databases offline
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 9161891..1f5670b 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -334,8 +334,8 @@ proc ColName2SqlSafeForm {colname} { return $colname } -proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {guest}} {id_number {}} {section_num {} } } { - set eval_str [concat INSERT INTO GradesTable (FirstName, LastName, UserName, PasswordHash, GroupName, IdNum, SectionNum) VALUES('$first_name', '$last_name', '$user_name', '$password_hash', '$group_name', '$id_number', '$section_num')] +proc AddUserNonWeb { first_name last_name user_name {group_name {guest}} {id_number {}} {section_num {} } } { + set eval_str [concat INSERT INTO GradesTable (FirstName, LastName, UserName, GroupName, IdNum, SectionNum) VALUES('$first_name', '$last_name', '$user_name', '$group_name', '$id_number', '$section_num')] set err [catch {db eval $eval_str } errStat] if { $err } { htmlErrorMsg $errStat @@ -396,7 +396,6 @@ proc GetDefaultGradesTableColumn {} { FirstName text\ LastName text\ UserName text\ - PasswordHash text\ GroupName text\ UserHiddenColums text\ UserHiddenGroups text\ @@ -570,12 +569,12 @@ proc CreateGradesTable {db} { } # add special users aka special info rows - AddUserNonWeb {} {} _Col_Category_ {} inforow - AddUserNonWeb {} {} _Max_Points_ {} inforow - AddUserNonWeb {} {} _Visible_To_Students_ {} inforow + AddUserNonWeb {} {} _Col_Category_ inforow + AddUserNonWeb {} {} _Max_Points_ inforow + AddUserNonWeb {} {} _Visible_To_Students_ inforow # reasonable defaults for hidden columns - #set instructor_hidden_columns [list UserHiddenColums PasswordHash UserHiddenGroups IdNum] + #set instructor_hidden_columns [list UserHiddenColums UserHiddenGroups IdNum] #UpdateColValue4GroupNameNonWeb UserHiddenColums instructor $instructor_hidden_columns } @@ -710,9 +709,9 @@ proc htmlDBout {db permission_list user {sort_col {}}} { # set hidden column list switch $permission(GroupName) { instructor { set hidden_columns {} } - ta { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum] } - student { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } - dropped { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } + ta { set hidden_columns [list UserName GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum] } + student { set hidden_columns [list UserName GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } + dropped { set hidden_columns [list UserName GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } guest { set hidden_columns $column_list } default { set hidden_columns $column_list } } @@ -791,7 +790,6 @@ proc htmlDBout {db permission_list user {sort_col {}}} { FirstName { lappend action_list changefirstname } LastName { lappend action_list changelastname } UserName { lappend action_list changeusername } - PasswordHash { } UserHiddenColums { } UserHiddenGroups { } UserHiddenGradeCategories { } @@ -1349,7 +1347,7 @@ proc AddNewUserInfo {db permission_list user } { htmlInfoMsg "Unknown group name {$group_name} replaced with {guest}." set group_name guest } - AddUserNonWeb $first_name $last_name $login {} $group_name $id_number $section_number + AddUserNonWeb $first_name $last_name $login $group_name $id_number $section_number } } @@ -1882,9 +1880,8 @@ proc Authenticate_User { user_requested password } { return $user } -proc AccessGroupRights {db user password } { +proc AccessGroupRights {db user } { dbg "access rights check for user: $user" msg_level_info - set PasswordHash [::md5::md5 -hex $password] set eval_str [list SELECT GroupName FROM GradesTable WHERE UserName='$user'] db eval $eval_str group_name_array {} if { [ info exist group_name_array(GroupName) ] } { |