Skip to content

Commit

Permalink
Fixed issue with roles not getting updated and enabling referee when …
Browse files Browse the repository at this point in the history
…user not enabled.
  • Loading branch information
jp31415926 committed Sep 27, 2019
1 parent 79eb073 commit 73a4a10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Scheduler/SchBundle/Scripts/CheckCerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ function sendEmailMessage($emailTo, $subject, $msg, $emailCc = array())
$valid_my = 1;
if ($verbose) echo "MY valid\n";
}
$referee = ($cert > 0) && $safeHaven && $concussion && $valid_my;
$referee = ($user['enabled'] == '1') && ($cert > 0) && $safeHaven && $concussion && $valid_my;

// if they are already enabled, don't disable them.
if (!$referee && $user['role_referee']) {
Expand All @@ -1117,12 +1117,13 @@ function sendEmailMessage($emailTo, $subject, $msg, $emailCc = array())
if (!$concussion) {
$aysoMY .= " C";
}
$rolesUpdated = UpdateRoles($roles, $referee); // make sure roles array matches referee role
if (
($user['role_referee'] != $referee) || // referee role changed?
($user['ayso_my'] != $aysoMY) || // MY changed?
($user['badge'] != $Badges[$cert]) || // badge changed?
($user['is_youth'] != $is_youth) || // youth status changed?
UpdateRoles($roles, $referee) // make sure roles array matches referee role
$rolesUpdated
) {
if (($user['role_referee'] != $referee)) {
if ($referee) {
Expand Down

0 comments on commit 73a4a10

Please sign in to comment.