strangerstudios / pmpro-approvals

Grants administrators the ability to approve/deny memberships after signup.
https://www.paidmembershipspro.com/add-ons/approval-process-membership/
19 stars 27 forks source link

Make sure this works with our getfile script and "lock down files" methods #39

Open ideadude opened 6 years ago

ideadude commented 6 years ago

Someone on the forums mentioned that users who weren't approved could gain access to files anyway.

Since we call pmpro_has_membership_access() here https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/getfile.php#L74 that should be filtered by PMPro Approvals, but maybe the plugin hasn't loaded yet or something else is going on.

This custom gist (for locking down files outside of WP) uses the pmpro_hasMembershipLevel function and should also be filtered. https://gist.github.com/strangerstudios/6599510#file-my_pmpro_getfile-php-L64

If the user is using a custom getfile script anyway, it could be updated to check the status of the user's membership.

gausam commented 3 years ago

@andrewlimaza The Approvals Add On filters the membership level correctly in all the scenarios I tested with. Something else was probably off in the user's installation or the Add On hadn't loaded yet for some reason.