Closed GatesheadBen closed 5 years ago
Is the problem that congregations with attendance disabled are appearing in the list or that congregations the current user shouldn't see are appearing in the list?
Congregations with attendance disabled are appearing in the list.
On Tue, 13 Nov 2018 at 21:49, Tom Barrett notifications@github.com wrote:
Is the problem that congregations with attendance disabled are appearing in the list or that congregations the current user shouldn't see are appearing in the list?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tbar0970/jethro-pmm/issues/544#issuecomment-438450976, or mute the thread https://github.com/notifications/unsubscribe-auth/AL7vIve83BDjtFUFKFf9JRh0-3GBpNTFks5uuz5qgaJpZM4XY9me .
-- 07858 739412 11 Jubilee Ave - NE9 7HN
Hi Tom, I've started looking into this now.
Steps to reproduce:
It looks to me like congregation.class.php lines 75 to 79 are removing the '!attendance_recording_days' => 0 from the logic part of the query.
i.e. my un-restricted user gets WHERE (NOT (congregation.attendance_recording_days = '0')) and my restricted user gets WHERE congregation.id IN ('2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','7','7','7','7','7','7','7','7','7','7','7','7','7','7','7','8','8','8','8','8','8','8','8','8','8','8','8','8','8','8','11','11','11','11','11','11','11','11','11','11','11','11','11','11','11','14','14','14','14','14','14','14','14','14','14','14','14','14','14','14','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15') AND (congregation.id IN ('2','2','2','2','2','2','2','2','2','2','2','2','2','2','2','7','7','7','7','7','7','7','7','7','7','7','7','7','7','7','8','8','8','8','8','8','8','8','8','8','8','8','8','8','8','11','11','11','11','11','11','11','11','11','11','11','11','11','11','11','14','14','14','14','14','14','14','14','14','14','14','14','14','14','14','15','15','15','15','15','15','15','15','15','15','15','15','15','15','15') )
I suspect line 79 should change from if ($oldwhere) $res['where'] .= ' AND ('.$res['where'].')'; to if ($oldwhere) $res['where'] .= ' AND ('.$oldwhere.')';
???
Thanks,
Ben
Thanks, that sounds right, I've committed that fix.
1) A non-admin user is restricted to congregations 2) Congregations are disabled for attendance 3) The non-admin user still sees congregations listed in the attendance drop down menu
(Note: We have half a dozen congregations because we want to have rotas for mid-week events)