wpsharks / s2member

s2Member® Framework (membership management for WordPress®).
64 stars 36 forks source link

Feature Request: URI Restrictions for Custom Capabilities #336

Open colinhahn opened 10 years ago

colinhahn commented 10 years ago

May I submit a feature request to extend the URI restrictions UI to also support URI restrictions by custom capabilities? It would be great to be able to enter a URI fragment and the custom capability that a user would need to have in order to access that URI.

KTS915 commented 10 years ago

I agree.

raamdev commented 9 years ago

@colinhahn Thanks for the feature request! I'm sorry it took so long to get back to you here.

I've gone ahead and marked this as a feature request, to be considered for a future development cycle.

ryantcarter commented 9 years ago

@raamdev Are there any tweaks that can be made to the s2-hacks.php code on this forum thread to have it work in this version of S2Member?

http://www.s2member.com/forums/topic/uri-and-custom-capabilties/

colinhahn commented 9 years ago

In my own hacks file, I've used that code. It needs to be expanded to add the URL parameters for the redirect to the MOP. But, the core logic seems to work in my internal use. I don't see a reason why that code couldn't be extended to run through whatever is input through a GUI.

Colin J. Hahn

On Tue, Dec 23, 2014 at 10:00 AM, Ryan Carter notifications@github.com wrote:

@raamdev https://github.com/raamdev Are there any tweaks that can be made to the s2-hacks.php code on this forum thread to have it work in this version of S2Member?

http://www.s2member.com/forums/topic/uri-and-custom-capabilties/

— Reply to this email directly or view it on GitHub https://github.com/websharks/s2member/issues/336#issuecomment-67965793.

ryantcarter commented 9 years ago

@colinhahn I've tried to use it but I'm not having much joy. The users can still view any group regardless of CCAP. How are your groups configured? Private or Public? I don't imagine it should make a difference?

I'm trying to work on some PHP that autojoins everyone to every group. Then just use the code detailed above to limit the content.

EDIT: Managed to fix it, wasn't using the full URI.

Managed to get members auto added to BP as well using this code in my themes functions.php

function automatic_group_membership( $user_id ) {
if( !$user_id )
return false;

groups_accept_invite( $user_id, 6 );
groups_accept_invite( $user_id, 5 );
groups_accept_invite( $user_id, 2 );
groups_accept_invite( $user_id, 1 );
}
add_action( 'user_register', 'automatic_group_membership' );`

Not sure if there's a better way of writing those 4 lines, i'm sure there is. I'm still new to PHP.

lugfug commented 7 years ago

I would like to add my voice to the request for adding URI restriction by Custom Capability in the GUI instead of a mu_plugin.

It may be functional to do this in a php file, but its a LOT more convenient in the s2Member Dashboard GUI.

Please consider fast tracking this VERY useful function.

Lifeischoice commented 7 years ago

+1

kozzmen commented 7 years ago

+1 for this feature request!