[system] / branches / rel-2-4-dev / webwork-modperl / lib / WeBWorK.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-4-dev/webwork-modperl/lib/WeBWorK.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3743 Revision 3833
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.77 2005/10/11 20:44:59 sh002i Exp $ 4# $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.78 2005/11/07 21:18:37 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.
189 my $id = $upload->id; 189 my $id = $upload->id;
190 my $hash = $upload->hash; 190 my $hash = $upload->hash;
191 $r->param($u->name => "$id $hash"); 191 $r->param($u->name => "$id $hash");
192 } 192 }
193 193
194 my ($db, $authz); 194 # create these out here. they should fail if they don't have the right information
195 # this lets us not be so careful about whether these objects are defined when we use them.
196 # instead, we just create the behavior that if they don't have a valid $db they fail.
197 my $authz = new WeBWorK::Authz($r);
198 $r->authz($authz);
199 my $authen = new WeBWorK::Authen($r);
200 $r->authen($authen);
201
202 my $db;
195 203
196 if ($displayArgs{courseID}) { 204 if ($displayArgs{courseID}) {
197 debug("We got a courseID from the URLPath, now we can do some stuff:\n"); 205 debug("We got a courseID from the URLPath, now we can do some stuff:\n");
198 206
199 unless (-e $ce->{courseDirs}->{root}) { 207 unless (-e $ce->{courseDirs}->{root}) {
214 debug("set displayModule to $displayModule\n"); 222 debug("set displayModule to $displayModule\n");
215 } else { 223 } else {
216 debug("hashDatabaseOK() returned $dbOK -- leaving displayModule as-is\n"); 224 debug("hashDatabaseOK() returned $dbOK -- leaving displayModule as-is\n");
217 } 225 }
218 226
219 debug("Create an authz object (Authen needs it to check login permission)...\n");
220 $authz = new WeBWorK::Authz($r);
221 debug("(here's the authz object: $authz)\n");
222 $r->authz($authz);
223
224 debug("...and now we can authenticate the remote user...\n");
225 my $authen = new WeBWorK::Authen($r);
226 $r->authen($authen);
227 my $authenOK = $authen->verify; 227 my $authenOK = $authen->verify;
228 if ($authenOK) { 228 if ($authenOK) {
229 my $userID = $r->param("user"); 229 my $userID = $r->param("user");
230 debug("Hi, $userID, glad you made it.\n"); 230 debug("Hi, $userID, glad you made it.\n");
231 231
276 $displayModule = AUTHEN_MODULE; 276 $displayModule = AUTHEN_MODULE;
277 debug("set displayModule to $displayModule\n"); 277 debug("set displayModule to $displayModule\n");
278 } 278 }
279 } 279 }
280 280
281 ## if a course ID was given in the URL and resulted in an error (as stored in $!) 281 # make fake authen/authz objects that just fail
282 ## it probably means that the course does not exist or was misspelled 282 $authen =
283 #if ($displayArgs{courseID} and $ce->{'!'}) {
284 # debug("Something was wrong with the courseID: \n");
285 # debug("\t\t" . $ce->{'!'} . "\n");
286 # debug("Time to bail!\n");
287 # die "An error occured while accessing '$displayArgs{courseID}': '", $ce->{'!'}, "'.\n";
288 #}
289 283
290 # store the time before we invoke the content generator 284 # store the time before we invoke the content generator
291 my $cg_start = time; # this is Time::HiRes's time, which gives floating point values 285 my $cg_start = time; # this is Time::HiRes's time, which gives floating point values
292 286
293 debug(("-" x 80) . "\n"); 287 debug(("-" x 80) . "\n");

Legend:
Removed from v.3743  
changed lines
  Added in v.3833

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9