diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-24 21:34:30 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-24 21:34:30 -0500 |
commit | 494e45d4f08841bd9b2d56f3ced8418f8aa1d008 (patch) | |
tree | fedfed125ff9333b07d233bda2dc83dfa3eb7ae5 /AddDummyUsers2db.tcl | |
parent | b322dd885e403492f818a5110a9a7957a6b304ce (diff) | |
download | GradeBook-494e45d4f08841bd9b2d56f3ced8418f8aa1d008.tar.gz GradeBook-494e45d4f08841bd9b2d56f3ced8418f8aa1d008.zip |
all shared procs move to library file
Ignore-this: 75e219cb44fc45e281a42d514cf2600f
darcs-hash:20110125023430-067c0-ed0225f6b7d24c31e9f8eb4498a04191abf7f355.gz
Diffstat (limited to 'AddDummyUsers2db.tcl')
-rwxr-xr-x | AddDummyUsers2db.tcl | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/AddDummyUsers2db.tcl b/AddDummyUsers2db.tcl index 3eaeef2..2861b45 100755 --- a/AddDummyUsers2db.tcl +++ b/AddDummyUsers2db.tcl @@ -5,6 +5,7 @@ exec tclsh "$0" "$@" package require sqlite3 package require md5 +source ./GradeBook_lib.tcl set class [lindex $argv 0] if { $class eq "" } { @@ -15,28 +16,6 @@ set dbfile $class sqlite3 db $dbfile -proc dbg {msg {level 1}} { - if { $level <=2 } { - set fid [open log a+] - puts $fid $msg - close $fid - } -} - -proc htmlErrorMsg { msg } { - puts "<div class=\"errormsg\">error: $msg</div>" -} - -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')] - set err [catch {db eval $eval_str } errStat] - if { $err } { - htmlErrorMsg $errStat - dbg "the following error happen: $errStat" 3 - } -} - - #AddUserNonWeb first_name last_name user_name password_hash group_name id_number section_num i # dummy users #AddUserNonWeb Ins "Instruch I" instructor [::md5::md5 -hex qwerty] instructor |