Page 1 of 1

Restricting profile.php?

PostPosted: July 12th, 2011, 9:32 pm
by fcandillo
I have free subscribers at Level #0 access.

However, I don't want to allow them to access their profile.

I tried using the
URIs That Require Level #1 Or Higher:
/profile.php

however, it seems I can't restrict access this way.

How can I restrict access for Level #0 to the /wp-admin/profile.php ?

Re: Restricting profile.php?

PostPosted: July 13th, 2011, 2:54 am
by Cristián Lávaque
s2Member restrictions don't apply to the admin side of WordPress. You could look inside /wp-admin/user-edit.php and find a hook that lets you do this.

Re: Restricting profile.php?

PostPosted: July 15th, 2011, 8:49 am
by fcandillo
Using the "Front-End Users" plugin, I found that I could restrict access for different roles to the /wp-admin/ area. Since the 'Subscriber' role is equal to 's2Member Level 0', I don't allow 'Subscriber' Roles with Admin Access.

I am also using the "Sidebar Login" plugin. It allows me to place different links depending on role capabilities. I used the "User Role Editor" to create a custom capability of 'profile_no' and gave this capability to the 'Subscriber' role.

Then, with the "Sidebar Login" plugin, I created a link to the profile.php page for those with 'access_s2member_level1' capability and a link to the login-welcome page for those with 'profile_no' capability.

Re: Restricting profile.php?

PostPosted: July 16th, 2011, 12:01 am
by Cristián Lávaque
Oh, very cool. Thanks for sharing how you did it. :)

Does https://wordpress.org/extend/plugins/front-end-users/ show s2Member's custom registration fields in the profile page it creates?

Re: Restricting profile.php?

PostPosted: July 16th, 2011, 6:22 am
by fcandillo
No, unfortunately it does not show s2Member's custom registration fields in the profile page. I will have to customize that somehow.

Re: Restricting profile.php?

PostPosted: July 16th, 2011, 5:35 pm
by Cristián Lávaque
Ah ok. Search the forums, there have been a few hacks posted related to custom fields, they should help you with this. :)