WordPress.org

Forums

Paid Memberships Pro
[resolved] HELP = Lock down special pages (3 posts)

  1. websitesdivine
    Member
    Posted 2 years ago #

    I run a dating site and it creates pages that use a ? in the url and you cannot get to the Page/post per say to lock it down. I had s2 before and they had a hack to add to the mu-plugins folder that would handle these custom page permissions. Can you help? Below is an example of the php hack they used.

    You can see that the first page it protects is /members/?pid-2

    All member pages are like this.

    Perhaps someone can reveal what similar hack I can use so I can dump s2....

    <?php
    add_action ('wp_loaded', 'ccap_uri_restriction', 1);
    function ccap_uri_restriction() {
    if (strpos($_SERVER['REQUEST_URI'], '/members/?pid=2') !== false && current_user_can('access_s2member_level0') === false) {
    wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    exit;
    }
    if (strpos($_SERVER['REQUEST_URI'], '/members/?pid=1&pagetitle=mypage') !== false && current_user_can('access_s2member_level0') === false) {
    wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    exit;
    }
    if (strpos($_SERVER['REQUEST_URI'], '/members/?pid=5&pagetitle=basic_search') !== false && current_user_can('access_s2member_level1') === false) {
    wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    exit;
    }
    if (strpos($_SERVER['REQUEST_URI'], '/members/?pid=14&pagetitle=my_email&message_template=inbox') !== false && current_user_can('access_s2member_level3') === false) {
    wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    exit;
    }
    if (strpos($_SERVER['REQUEST_URI'], '&pagetitle=my_blogs') !== false && current_user_can('access_s2member_level4') === false) {
    wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    exit;
    }
    }
    ?>

    http://wordpress.org/extend/plugins/paid-memberships-pro/

  2. websitesdivine
    Member
    Posted 2 years ago #

    The "why" is I want to use Stripe only!

  3. Jason Coleman
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for also signing up for support http://www.paidmembershipspro.com.

    I have followed up with you there.

    For others checking in here, check out the documentation at http://www.paidmembershipspro.com/documentation/advanced-techniques/require-membership-function/ RE using the pmpro_hasMembershipLevel() function, and RE using the home_url() or pmpro_url("levels") functions to pass to wp_redirect() instead.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Paid Memberships Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic