diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-23 20:58:30 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-23 20:58:30 -0500 |
commit | 2bef0ff4885425e5b0f0d8fe20098bff39aa0f86 (patch) | |
tree | e0c89dd9acc0dbc151f8fd6620f753808561cc4d | |
parent | 63b135f3ff3113aaeba84f35ae15fcecc1d3f450 (diff) | |
download | GradeBook-2bef0ff4885425e5b0f0d8fe20098bff39aa0f86.tar.gz GradeBook-2bef0ff4885425e5b0f0d8fe20098bff39aa0f86.zip |
added proper course database load, now this script can serve for different courses
Ignore-this: 8902a82202769d781f105e89763f9b38
darcs-hash:20110124015830-067c0-17c971e8b4ddb538aebb4e3ec8442660ffe50bfe.gz
-rwxr-xr-x | GradeBook.tcl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index a94bd5c..fc45e70 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -35,11 +35,7 @@ regsub -all {\?.*$} $coursedbfname "" coursedbfname regsub -all {^/} $coursedbfname "" coursedbfname set script_name "$script_name/$coursedbfname" -set dbfile "courses/$coursedbfname" - -#set url_base -sqlite3 db $dbfile # ########################## procs begin ################################# proc dbg {msg {level 1}} { @@ -851,17 +847,21 @@ dbg [::ncgi::names] 4 if { $action == "logon" } { LogMeOn; set action defaultview } if { $action == "logoff" } { LogMeOff; set action defaultview } -dbg "===== Connection at $timestamp for user $user =====" -set permission_list [AccessGroupRights db $user $password] ::ncgi::header htmlHeader puts "<body>" -htmlTop $permission_list -ChoseAction $action $permission_list $user -#htmlDefaultView $permission_list $user -#htmlGradesTable db $permission_list $user -#htmlDBout db $sortCol +set dbfile "courses/$coursedbfname" +if { ($coursedbfname ne "") && [file exists $dbfile] } { + sqlite3 db $dbfile + dbg "===== Connection at $timestamp for user $user =====" + set permission_list [AccessGroupRights db $user $password] + htmlTop $permission_list + ChoseAction $action $permission_list $user +} else { + htmlErrorMsg "No requested database {$coursedbfname}. Please, check your url" + dbg "Attemt to access non existing database: {$dbfile}" +} htmlFooter $permission_list puts "</body>" |