latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Kenny McNett

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 4 topics - 1 through 4 (of 4 total)
Topic Count Last Reply
Dev purchase for a client?

By:  Kenny McNett in: Community Forum

voices: 2
replies: 7

4 years, 7 months ago  Cristián Lávaque

More details for Alternative View Protection?

By:  Kenny McNett in: Community Forum

voices: 1
replies: 0

4 years, 7 months ago  Kenny McNett

A few questions before I buy the pro version

By:  Bruce Walker in: Community Forum

voices: 3
replies: 17

4 years, 8 months ago  Bruce Walker

Forum integration? Protected by CCAPs?

By:  Kenny McNett in: Community Forum

voices: 2
replies: 2

4 years, 9 months ago  Kenny McNett

Viewing 4 topics - 1 through 4 (of 4 total)

Topics I've Started

Viewing 3 topics - 1 through 3 (of 3 total)
Topic Count Last Reply
Dev purchase for a client?

By:  Kenny McNett in: Community Forum

voices: 2
replies: 7

4 years, 7 months ago  Cristián Lávaque

More details for Alternative View Protection?

By:  Kenny McNett in: Community Forum

voices: 1
replies: 0

4 years, 7 months ago  Kenny McNett

Forum integration? Protected by CCAPs?

By:  Kenny McNett in: Community Forum

voices: 2
replies: 2

4 years, 9 months ago  Kenny McNett

Viewing 3 topics - 1 through 3 (of 3 total)

My Latest Replies (From Various Topics)

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Monday May 21st, 2012 at 5:06 pm #14101

Glad to hear I’m not the only one that made that mistake :) Same thing with putting up several sites on shared hosting. Finally figured out that separate hosting via an affiliate account or a reseller account was a much better solution for that. No different than the setup here at s2member, so I understand.

I’ve seen a few more account management systems trending to allow for an adjunct dev account with permission to access the account but not have ownership, but not many. It’s a pretty niche need. But the ones I do see I really appreciate!

Waiting on client approval, then I’ll grab that license and fire a couple of questions your way. I don’t think we technically need the pro version, but I do need some support answers, so it’s all the same to me.

Thanks again for your amazing support.

Posted: Monday May 21st, 2012 at 4:43 pm #14096

Got it. I’m sure you’re aware that’s not ideal for a dev, but I can see how it makes things a ton easier on your end.

Feature request: Be able to log into my current forum account and get support on behalf of any client accounts I manage as a dev. That would aggregate my answers in one place for me and also give you a real # of actual people behind the # of registered accounts.

Cheers!

Posted: Monday May 21st, 2012 at 4:23 pm #14093

So, I can purchase the license for my client under my account and use it for their site? Then I can repeat that for a different client in the future?

Posted: Thursday May 10th, 2012 at 12:40 am #13113

Thanks Cristian, it took me a bit to figure out how to get the wordpress page ID as an integer dynamically, but I got things working.

For anyone else out there, here’s my solution for restricting bbPress access. In short, this checks if the current user has access to the most distant ancestor of the current page. For example:

Level 1 Forum/Category > Subforum1 > Subcategory > Subforum2 > Current Topic

No matter which page they arrive at in the tree, they must have access via s2member to the top-most level. Then it’s a simple matter of assigning a ccap to that Forum, or a membership level.

1. Include the following in your functions.php file
2. Include a call to the function in EACH of your bbPress template files BEFORE the template calls for the forum content. Match the HTML structure of the error message to suit your theme. You need to include closing tags for any open divs.
3. Test!

/******* bbPress Forum Access *******/
function checkForumAccess() {
	if(get_post_type() == 'forum' OR get_post_type() == 'topic' OR get_post_type() == 'reply') { // check if user is viewing a forum page. If so, continue.
	
	//check if they have access to the top-most parent forum/category (both are Pages in wordpress). If not, show the error verbiage. If they have access, continue and show the content like normal
	$parent = array_reverse(get_post_ancestors($post->ID)); // get an array of all the parent pages in order from most distant to closest.
	$first_parent = get_page($parent[0]); //get the first page in the array, which is the most distant parent
	$int = apply_filters('the_ID', $first_parent->ID); //filter the $first_parent to get only the wordpress page/post ID, which is an integer like 49 or 565. store it as a variable $int
	
		if (!is_page_permitted_by_s2member($int)) { // this is an s2member function. Check if the current user can access the $first_parent, via the stored page/post ID in the $int variable
// here comes your custom error message. Remember to \escape any apostrophes
			echo '
			<div>
				<h1 class="entry-title">Sorry!</h1>
				<div class="entry-content">
				<p>It looks like you don\'t have access to this forum.</p>
				<p>If this is an error and you should have access, please contact us here: (contact URL) 
			</div>
			</div><!--.postWrapper-->
		</div><!-- #content -->
	</div><!-- #contentWrapper -->
</div><!-- #primary -->
';
get_sidebar();
get_footer();
			exit; // Important. This prevents the rest of the page (the secure forum content) from displaying
		}
	}
}			 
Posted: Wednesday May 9th, 2012 at 9:10 pm #13105

Thanks! Correct me if I’m wrong, but those functions only take integers, right? Can I pass a var to that?

Posted: Wednesday May 9th, 2012 at 8:53 pm #13103

Cristian, I’m using bbpress and things are great. I can assign CCAPs on a per-forum basis via the wp page editor because bbpress treats each forum as a standard wordpress page.

But, when viewing a single page, I need to be able to restrict access to that page based on whether the user can access its parent page. Or, better, whether the user can access the last ancestor.

I can get the last ancestor page with normal wordpress commands:

$parent = array_reverse(get_post_ancestors($post->ID));
$first_parent = get_page($parent[0]);

But how do I check to see if the current user can access that page? If the user were to navigate to that page in a browser, they would be restricted by the CCAP on that page and redirected accordingly.

So close to solving this puzzle,

Thanks!

Kenny

Posted: Friday May 4th, 2012 at 5:31 am #12571

Thank you! I’ll take a shot at tweaking Jason’s code. I’m looking forward to core integration at some point :)

Until then, it’s hax0rz for me!

Best,
Kenny

Posted: Friday May 4th, 2012 at 5:09 am #12564

Thanks for the response. I found this thread after I asked the question to you: http://www.s2member.com/forums/topic/buddypress-with-s2member-pro/

Does that solution work? I’m not set on the forum I want to use, so if using buddypress means I can restrict forum access by ccap, then I’ll go with buddypress.

Posted: Friday May 4th, 2012 at 4:50 am #12558

Cristian, is there a way to implement URI restrictions based on CCAPs alone? The intention is to restrict access to certain parts of a forum based on a user’s CCAPs.

I really hope so!

Thanks for your stellar support,
Kenny

Posted: Tuesday Apr 10th, 2012 at 4:49 pm #10519

Thanks Dave. That’s a good lead.

In the end, I’m trying to restrict portions of the forum based on the ccap of a user instead of their user level. I’m assuming that’s going to have to be custom, but I figured I’d start with a forum that is known to work with s2member.

Heard anything about Mingle or any of the others?

Viewing 10 replies - 1 through 10 (of 10 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.