Skip to content

Commit

Permalink
Fix the fallback password in the addcourse script
Browse files Browse the repository at this point in the history
The conditional should check that the student_id contains a
non-whitespace character, not that it does not contain a non-whitespace
character.
  • Loading branch information
drgrice1 committed Aug 24, 2023
1 parent 76fe9e3 commit 8825339
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/addcourse
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if ($users) {

# Set the password if the password field is empty.
if (!defined $record{password} || $record{password} !~ /\S/) {
if (defined $record{student_id} && $record{student_id} !~ /\S/) {
if (defined $record{student_id} && $record{student_id} =~ /\S/) {
# Use the student ID if it is non-empty.
$record{password} = cryptPassword($record{student_id});
} else {
Expand Down

0 comments on commit 8825339

Please sign in to comment.