PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Protect other members profiles from current user?

s2Member Plugin. A Membership plugin for WordPress®.

Protect other members profiles from current user?

Postby candy » May 13th, 2011, 10:50 am

Hi,

Is there a way to protect not the whole members directory but only parts of the profiles?

Like for ex /members/%%user%%/profile/ ??!

That %%user%% does not seem to work, and I do not mean protectig the logged in user to see his onw profile, but I'd like to restrict his access to parts of the other user's profiles (like /userX/profile/, userX/activity) etc.?!?!

I'd like everyone to see the list of members but not have access to their complete profile
How is this done?!

Thank you!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Protect other members profiles from current user?

Postby Cristián Lávaque » May 13th, 2011, 12:05 pm

I replied to this here viewtopic.php?f=4&t=6415
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Protect other members profiles from current user?

Postby candy » May 13th, 2011, 1:58 pm

hmm .... I thought this issue was different ...
So there is no parameter for the "username" that one can parse in the URL?

Like you have for %%current_user_login%% - only that not for "current" !?!

Thanks!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Protect other members profiles from current user?

Postby Cristián Lávaque » May 13th, 2011, 2:43 pm

What URL? You have replacement codes for the redirection URL for the Login Welcome Page, but for any URL you can use the s2Member constant for the username.

WP Admin -> s2Member -> General Options -> Login Welcome Page -> Special Redirection URL
Wp Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_LOGIN
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Protect other members profiles from current user?

Postby candy » May 13th, 2011, 3:48 pm

well, that's the point! (or not :-) )

s2 all revolves around "current_user_is" or "current_user_can" so far so good, but how do I integrate the "user" (not the current, just a user; let's say I am logged in as candy (current_user=candy") and you are also a member of the community, but you are not current_user (cause I am at that point).

So how do I call an URL to see your profile?

mysite.com/members/%%???christian???%%/profile

is there a short code for that %%???christian???%% just as I do for %%current_user_login%% to get your user name in the url?

know what I mean?
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Protect other members profiles from current user?

Postby Cristián Lávaque » May 13th, 2011, 4:54 pm

Ah ok, got it now. Sorry for not understanding earlier.

You could try

Code: Select all
get_user_field('username'$user_id); 
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Protect other members profiles from current user?

Postby candy » May 13th, 2011, 5:18 pm

:-) we are getting there :-)

Now if you can also help me figure out how do I write the URL to insert into the URI Restrictions (typical w/budyypress) section

/members/???username???/profile/

you are my hero for today :-)

Thanks!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Protect other members profiles from current user?

Postby Cristián Lávaque » May 13th, 2011, 5:52 pm

The URI restriction will work on a whole level, not individual cases and other not of the same level... not yet, at least.

For now you'll have to protect the content in that page using the conditionals, checking the user and his level to do what you want.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron