Skip to content

Commit

Permalink
Merge pull request openwebwork#2327 from drgrice1/bugfix/login_proctor
Browse files Browse the repository at this point in the history
Fix proctor login for `login_proctor` users with `Proctor` status.
  • Loading branch information
Alex-Jordan authored Feb 23, 2024
2 parents 75f7716 + 57f13f8 commit 65a1b74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/WeBWorK/Authen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,10 @@ sub verify_normal_user {
my $auth_result = $self->authenticate;

if ($auth_result > 0) {
$self->{session_key} = $self->create_session($user_id);
$self->{initial_login} = 1;
# deny certain roles (dropped students, proctor roles)
unless ($c->ce->status_abbrev_has_behavior($c->db->getUser($user_id)->status, "allow_course_access")) {
unless ($self->{login_type} =~ /^proctor/
|| $c->ce->status_abbrev_has_behavior($c->db->getUser($user_id)->status, "allow_course_access"))
{
$self->{log_error} = "user not allowed course access";
$self->{error} = "This user is not allowed to log in to this course";
return 0;
Expand All @@ -519,6 +519,8 @@ sub verify_normal_user {
$self->{error} = "This user is not allowed to log in to this course";
return 0;
}
$self->{session_key} = $self->create_session($user_id);
$self->{initial_login} = 1;
return 1;
} elsif ($auth_result == 0) {
$self->{log_error} = "authentication failed";
Expand Down

0 comments on commit 65a1b74

Please sign in to comment.