| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.89 2006/07/26 22:20:04 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.90 2006/08/03 17:01:51 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 67 | } |
67 | } |
| 68 | } |
68 | } |
| 69 | |
69 | |
| 70 | use constant LOGIN_MODULE => "WeBWorK::ContentGenerator::Login"; |
70 | use constant LOGIN_MODULE => "WeBWorK::ContentGenerator::Login"; |
| 71 | use constant PROCTOR_LOGIN_MODULE => "WeBWorK::ContentGenerator::LoginProctor"; |
71 | use constant PROCTOR_LOGIN_MODULE => "WeBWorK::ContentGenerator::LoginProctor"; |
| 72 | use constant FIXDB_MODULE => "WeBWorK::ContentGenerator::FixDB"; |
|
|
| 73 | |
72 | |
| 74 | our %SeedCE; |
73 | our %SeedCE; |
| 75 | |
74 | |
| 76 | sub dispatch($) { |
75 | sub dispatch($) { |
| 77 | my ($apache) = @_; |
76 | my ($apache) = @_; |
| … | |
… | |
| 255 | |
254 | |
| 256 | debug("...we can create a database object...\n"); |
255 | debug("...we can create a database object...\n"); |
| 257 | $db = new WeBWorK::DB($ce->{dbLayout}); |
256 | $db = new WeBWorK::DB($ce->{dbLayout}); |
| 258 | debug("(here's the DB handle: $db)\n"); |
257 | debug("(here's the DB handle: $db)\n"); |
| 259 | $r->db($db); |
258 | $r->db($db); |
| 260 | |
|
|
| 261 | debug("Now we check the database...\n"); |
|
|
| 262 | debug("(we can detect if a hash-style database from WW1 has not be converted properly.)\n"); |
|
|
| 263 | my ($dbOK, @dbMessages) = $db->hashDatabaseOK(0); # 0 == don't fix |
|
|
| 264 | if (not $dbOK) { |
|
|
| 265 | debug("hashDatabaseOK() returned $dbOK -- looks like trouble...\n"); |
|
|
| 266 | $displayModule = FIXDB_MODULE; |
|
|
| 267 | debug("set displayModule to $displayModule\n"); |
|
|
| 268 | } else { |
|
|
| 269 | debug("hashDatabaseOK() returned $dbOK -- leaving displayModule as-is\n"); |
|
|
| 270 | } |
|
|
| 271 | |
259 | |
| 272 | my $authenOK = $authen->verify; |
260 | my $authenOK = $authen->verify; |
| 273 | if ($authenOK) { |
261 | if ($authenOK) { |
| 274 | my $userID = $r->param("user"); |
262 | my $userID = $r->param("user"); |
| 275 | debug("Hi, $userID, glad you made it.\n"); |
263 | debug("Hi, $userID, glad you made it.\n"); |