Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions lib/WeBWorK/ContentGenerator/Instructor/UserList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ use constant FORM_TITLES => {

# permissions needed to perform a given action
use constant FORM_PERMS => {
save_edit => 'modify_student_data',
edit => 'modify_student_data',
reset2_2fa => 'change_password',
import => 'modify_student_data',
export => 'modify_classlist_files',
add => 'modify_student_data',
delete => 'modify_student_data',
save_edit => 'modify_student_data',
edit => 'modify_student_data',
reset_2fa => 'change_password',
import => 'modify_student_data',
export => 'modify_classlist_files',
add => 'modify_student_data',
delete => 'modify_student_data',
};

use constant SORT_SUBS => {
Expand Down Expand Up @@ -504,10 +504,11 @@ sub reset_2fa_handler ($c) {
push @resultText, $c->maketext('You are not allowed to reset two factor authenticatio for [_1].', $userID);
next;
}
my $password = $db->getPassword($userID);
$password->otp_secret('');
$db->putPassword($password);
$num++;
if (my $password = $db->getPassword($userID)) {
$password->otp_secret('');
$db->putPassword($password);
}
++$num;
}

unshift @resultText, $c->maketext('Reset two factor authentication for [quant,_1,user].', $num);
Expand Down
Loading