| … | |
… | |
| 81 | if ($@) { # If there was an error getting the requested course |
81 | if ($@) { # If there was an error getting the requested course |
| 82 | # TODO: display an error page. For now, 404 it. |
82 | # TODO: display an error page. For now, 404 it. |
| 83 | warn $@; |
83 | warn $@; |
| 84 | return DECLINED; |
84 | return DECLINED; |
| 85 | } |
85 | } |
| 86 | |
86 | |
| 87 | # Freak out if the requested course doesn't exist. For now, this is just a |
87 | # Freak out if the requested course doesn't exist. For now, this is just a |
| 88 | # check to see if the course directory exists. |
88 | # check to see if the course directory exists. |
| 89 | if (!-e $course_env->{webworkDirs}->{courses} . "/$course") { |
89 | if (!-e $course_env->{webworkDirs}->{courses} . "/$course") { |
| 90 | warn "Course directory for $course not found at " |
90 | warn "Course directory for $course not found at " |
| 91 | . $course_env->{webworkDirs}->{courses} . "/$course" ."\n"; |
91 | . $course_env->{webworkDirs}->{courses} . "/$course" ."\n"; |
| … | |
… | |
| 95 | ### Begin dispatching ### |
95 | ### Begin dispatching ### |
| 96 | |
96 | |
| 97 | # WeBWorK::Authen::verify erases the passwd field and sets the key field |
97 | # WeBWorK::Authen::verify erases the passwd field and sets the key field |
| 98 | # if login is successful. |
98 | # if login is successful. |
| 99 | if (!WeBWorK::Authen->new($r, $course_env)->verify) { |
99 | if (!WeBWorK::Authen->new($r, $course_env)->verify) { |
|
|
100 | # *** &verify should throw a descriptive exception on weird failures |
| 100 | return WeBWorK::ContentGenerator::Login->new($r, $course_env)->go; |
101 | return WeBWorK::ContentGenerator::Login->new($r, $course_env)->go; |
| 101 | } else { |
102 | } else { |
| 102 | # After we are authenticated, there are some things that need to be |
103 | # After we are authenticated, there are some things that need to be |
| 103 | # sorted out, Authorization-wize, before we start dispatching to individual |
104 | # sorted out, Authorization-wize, before we start dispatching to individual |
| 104 | # content generators. |
105 | # content generators. |