Parent Directory
|
Revision Log
This commit was manufactured by cvs2svn to create branch 'rel-2-0-patches'.
1 #!perl 2 ################################################################################ 3 # WeBWorK Online Homework Delivery System 4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ 5 # $CVSHeader: webwork-modperl/conf/database.conf.dist,v 1.11 2004/06/08 20:03:10 sh002i Exp $ 6 # 7 # This program is free software; you can redistribute it and/or modify it under 8 # the terms of either: (a) the GNU General Public License as published by the 9 # Free Software Foundation; either version 2, or (at your option) any later 10 # version, or (b) the "Artistic License" which comes with this package. 11 # 12 # This program is distributed in the hope that it will be useful, but WITHOUT 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the 15 # Artistic License for more details. 16 ################################################################################ 17 18 =head1 NAME 19 20 database.conf - define stantad database layouts 21 22 =head1 SYNOPSIS 23 24 In global.conf: 25 26 include "conf/database.conf"; 27 *dbLayout = $dbLayouts{layoutName}; 28 29 =head1 DESCRIPTION 30 31 This file contains definitions for the commonly-used database layouts. Database 32 layouts consist of all the information necessary to describe how to access data 33 used by WeBWorK. For more information on the format of a database layout, 34 consult the documentation for the WeBWorK::DB module. 35 36 A database layout is selected from the list of possible layouts by adding a 37 line like the one below to the F<global.conf> or F<course.conf> file. 38 39 $dbLayoutName = "layoutName"; 40 *dbLayout = $dbLayouts{$dbLayoutName}; 41 42 =cut 43 44 %dbLayouts = (); # layouts are added to this hash below 45 46 =head1 THE SQL DATABASE LAYOUT ($dbLayouts{sql}) 47 48 The SQL database layout uses an SQL database server to store the tables of the 49 WeBWorK database. The SQL driver uses two SQL accounts, a read only and a 50 read-write account. The read-only account must have C<SELECT> access, and the 51 read-write account needs C<SELECT>, C<INSERT>, C<UPDATE>, and C<DELETE> access. 52 The names and passwords of these accounts are given as parameters to each table 53 in the layout. 54 55 usernameRO the name of the read-only account 56 usernameRW the name of the read-write account 57 passwordRO the password for the read-only account 58 passwordRW the password for the read-write account 59 60 Be default, the name of the read-only account is "webworkRead", and the name of 61 the read-write account is "webworkWrite". There are no passwords by default. 62 It is not recommended that you use only passwords to secure database access. 63 Most RDBMSs allow IP-based authorization as well. As the system administrator, 64 IT IS YOUR RESPONSIBILITY TO SECURE DATABASE ACCESS. 65 66 Don't confuse the accounts above with the accounts of the users of a course. 67 These are system-wide accounts which allow WeBWorK to talk to the database 68 server. 69 70 Other parameters that can be given are as follows: 71 72 tableOverride an alternate name to use when referrring to the table (used 73 when a table name is a resereved word) 74 fieldOverride a hash mapping WeBWorK field names to alternate names to use 75 when referring to those fields (used when one or more field 76 names are reserved words) 77 debug if true, SQL statments are printed before being executed 78 79 =cut 80 81 my %sqlParams = ( 82 usernameRO => "webworkRead", 83 passwordRO => "", 84 usernameRW => "webworkWrite", 85 passwordRW => "", 86 debug => 0, 87 ); 88 89 $dbLayouts{sql} = { 90 password => { 91 record => "WeBWorK::DB::Record::Password", 92 schema => "WeBWorK::DB::Schema::SQL", 93 driver => "WeBWorK::DB::Driver::SQL", 94 source => "dbi:mysql:webwork_$courseName", 95 params => { %sqlParams }, 96 }, 97 permission => { 98 record => "WeBWorK::DB::Record::PermissionLevel", 99 schema => "WeBWorK::DB::Schema::SQL", 100 driver => "WeBWorK::DB::Driver::SQL", 101 source => "dbi:mysql:webwork_$courseName", 102 params => { %sqlParams }, 103 }, 104 key => { 105 record => "WeBWorK::DB::Record::Key", 106 schema => "WeBWorK::DB::Schema::SQL", 107 driver => "WeBWorK::DB::Driver::SQL", 108 source => "dbi:mysql:webwork_$courseName", 109 params => { 110 %sqlParams, 111 tableOverride => "key_not_a_keyword", 112 fieldOverride => { key => "key_not_a_keyword" }, 113 }, 114 }, 115 user => { 116 record => "WeBWorK::DB::Record::User", 117 schema => "WeBWorK::DB::Schema::SQL", 118 driver => "WeBWorK::DB::Driver::SQL", 119 source => "dbi:mysql:webwork_$courseName", 120 params => { %sqlParams }, 121 }, 122 set => { 123 record => "WeBWorK::DB::Record::Set", 124 schema => "WeBWorK::DB::Schema::SQL", 125 driver => "WeBWorK::DB::Driver::SQL", 126 source => "dbi:mysql:webwork_$courseName", 127 params => { 128 %sqlParams, 129 tableOverride => "set_not_a_keyword" 130 }, 131 }, 132 set_user => { 133 record => "WeBWorK::DB::Record::UserSet", 134 schema => "WeBWorK::DB::Schema::SQL", 135 driver => "WeBWorK::DB::Driver::SQL", 136 source => "dbi:mysql:webwork_$courseName", 137 params => { %sqlParams }, 138 }, 139 problem => { 140 record => "WeBWorK::DB::Record::Problem", 141 schema => "WeBWorK::DB::Schema::SQL", 142 driver => "WeBWorK::DB::Driver::SQL", 143 source => "dbi:mysql:webwork_$courseName", 144 params => { %sqlParams }, 145 }, 146 problem_user => { 147 record => "WeBWorK::DB::Record::UserProblem", 148 schema => "WeBWorK::DB::Schema::SQL", 149 driver => "WeBWorK::DB::Driver::SQL", 150 source => "dbi:mysql:webwork_$courseName", 151 params => { %sqlParams }, 152 }, 153 }; 154 155 =head1 THE GDBM DATABASE LAYOUT ($dbLayouts{gdbm}) 156 157 This layout uses the traditional WeBWorK 1.x database format, using the GDBM 158 file format. Use this layout if you wish to share courses between WeBWorK 1.x 159 and WeBWorK 2. 160 161 The C<globalUserID> parameter given for the C<set> and C<problem> tables denotes 162 the ID of the user that the GlobalTableEmulator will use to store data for the 163 C<set> and C<problem> tables. This is set to "global_user" by default, but can 164 be overridden on a course-by-course basis to the ID of the professor who is most 165 likely to be involved in creating new problem sets. Sets which have not been 166 assigned will only be visible to this user when logging into WeBWorK 1.x. 167 168 Use the following code to override these values in a course's F<course.conf> 169 file: 170 171 $dbLayout{set}->{params}->{globalUserID} = "some_user"; 172 $dbLayout{problem}->{params}->{globalUserID} = "some_user"; 173 174 =cut 175 176 my %gdbmGlobalTableParams = ( 177 globalUserID => "global_user", 178 ); 179 180 my %gdbmUserSpecificTableParams = ( 181 psvnLength => 5, 182 ); 183 184 $dbLayouts{gdbm} = { 185 password => { 186 record => "WeBWorK::DB::Record::Password", 187 schema => "WeBWorK::DB::Schema::Auth1Hash", 188 driver => "WeBWorK::DB::Driver::GDBM", 189 source => "$courseDirs{auth_DATA}/$courseName\_password_DB", 190 }, 191 permission => { 192 record => "WeBWorK::DB::Record::PermissionLevel", 193 schema => "WeBWorK::DB::Schema::Auth1Hash", 194 driver => "WeBWorK::DB::Driver::GDBM", 195 source => "$courseDirs{auth_DATA}/$courseName\_permissions_DB", 196 }, 197 key => { 198 record => "WeBWorK::DB::Record::Key", 199 schema => "WeBWorK::DB::Schema::Auth1Hash", 200 driver => "WeBWorK::DB::Driver::GDBM", 201 source => "$courseDirs{auth_DATA}/keys", 202 }, 203 user => { 204 record => "WeBWorK::DB::Record::User", 205 schema => "WeBWorK::DB::Schema::Classlist1Hash", 206 driver => "WeBWorK::DB::Driver::GDBM", 207 source => "$courseDirs{DATA}/$courseName\_classlist_DB", 208 }, 209 set => { 210 record => "WeBWorK::DB::Record::Set", 211 schema => "WeBWorK::DB::Schema::GlobalTableEmulator", 212 driver => "WeBWorK::DB::Driver::Null", 213 params => { %gdbmGlobalTableParams }, 214 }, 215 set_user => { 216 record => "WeBWorK::DB::Record::UserSet", 217 schema => "WeBWorK::DB::Schema::WW1Hash", 218 driver => "WeBWorK::DB::Driver::GDBM", 219 source => "$courseDirs{DATA}/$courseName\_webwork_DB", 220 params => { %gdbmUserSpecificTableParams }, 221 }, 222 problem => { 223 record => "WeBWorK::DB::Record::Problem", 224 schema => "WeBWorK::DB::Schema::GlobalTableEmulator", 225 driver => "WeBWorK::DB::Driver::Null", 226 params => { %gdbmGlobalTableParams }, 227 }, 228 problem_user => { 229 record => "WeBWorK::DB::Record::UserProblem", 230 schema => "WeBWorK::DB::Schema::WW1Hash", 231 driver => "WeBWorK::DB::Driver::GDBM", 232 source => "$courseDirs{DATA}/$courseName\_webwork_DB", 233 params => { %gdbmUserSpecificTableParams }, 234 }, 235 };
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |