Skip to content

Commit

Permalink
[libraries] Get examiner sites by UserID (#8994)
Browse files Browse the repository at this point in the history
Fix bug where if a user has the same full name as another user, the examiner sites from the other user will show up in the edit user page.
  • Loading branch information
CamilleBeau committed Dec 12, 2023
1 parent 6b67272 commit 5b7ddb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/libraries/User.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ class User extends UserPermissions implements
epr.pending_approval
FROM examiners e
JOIN examiners_psc_rel epr ON (e.examinerID=epr.examinerID)
WHERE e.full_name=:fn
WHERE e.userID=:uid
AND (epr.active='Y'
OR (epr.active='N' AND epr.pending_approval='Y')
)",
[
"fn" => $row['Real_name'],
"uid" => $row['ID'],
]
);

Expand Down
1 change: 1 addition & 0 deletions test/unittests/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class UserTest extends TestCase
* @var array
*/
private $_examinerInfo = [0 => ['full_name' => 'John Doe',
'userID' => '1',
'examinerID' => 1,
'radiologist' => 1
]
Expand Down

0 comments on commit 5b7ddb2

Please # to comment.