| … | |
… | |
| 366 | my $ce = $self->{courseEnvironment}; |
366 | my $ce = $self->{courseEnvironment}; |
| 367 | my $userName = $self->{r}->param("user"); |
367 | my $userName = $self->{r}->param("user"); |
| 368 | my $courseName = $ce->{courseName}; |
368 | my $courseName = $ce->{courseName}; |
| 369 | my $root = $ce->{webworkURLs}->{root}; |
369 | my $root = $ce->{webworkURLs}->{root}; |
| 370 | my $permLevel = WeBWorK::DB::Auth->new($ce)->getPermissions($userName); |
370 | my $permLevel = WeBWorK::DB::Auth->new($ce)->getPermissions($userName); |
|
|
371 | my $key = WeBWorK::DB::Auth->new($ce)->getKey($userName); |
| 371 | return "" unless defined $permLevel; |
372 | return "" unless defined $key; |
| 372 | |
373 | |
| 373 | my $probSets = "$root/$courseName/?" . $self->url_authen_args(); |
374 | my $probSets = "$root/$courseName/?" . $self->url_authen_args(); |
| 374 | my $prefs = "$root/$courseName/options/?" . $self->url_authen_args(); |
375 | my $prefs = "$root/$courseName/options/?" . $self->url_authen_args(); |
| 375 | my $prof = "$root/$courseName/prof/?" . $self->url_authen_args(); |
376 | my $prof = "$root/$courseName/prof/?" . $self->url_authen_args(); |
| 376 | my $profLine; |
|
|
| 377 | if ($permLevel > 0) { |
|
|
| 378 | $profLine = CGI::a({-href=>$prof}, "Professor") . CGI::br(), |
|
|
| 379 | } |
|
|
| 380 | my $help = $ce->{webworkURLs}->{docs} . "?" . $self->url_authen_args(); |
377 | my $help = $ce->{webworkURLs}->{docs} . "?" . $self->url_authen_args(); |
| 381 | my $logout = "$root/$courseName/?user=$userName"; |
378 | my $logout = "$root/$courseName/logout/?" . $self->url_authen_args(); |
|
|
379 | |
|
|
380 | my $profLine = ($permLevel > 0) |
|
|
381 | ? CGI::a({-href=>$prof}, "Professor") . CGI::br() |
|
|
382 | : ""; |
|
|
383 | #if ($permLevel > 0) { |
|
|
384 | # $profLine = CGI::a({-href=>$prof}, "Professor") . CGI::br(), |
|
|
385 | #} |
| 382 | |
386 | |
| 383 | return |
387 | return |
| 384 | CGI::a({-href=>$probSets}, "Problem Sets"), CGI::br(), |
388 | CGI::a({-href=>$probSets}, "Problem Sets"), CGI::br(), |
| 385 | CGI::a({-href=>$prefs}, "User Options"), CGI::br(), |
389 | CGI::a({-href=>$prefs}, "User Options"), CGI::br(), |
| 386 | $profLine, |
390 | $profLine, |