Support » Plugin: Paid Memberships Pro » HELP = Lock down special pages

  • Resolved websitesdivine

    (@websitesdivine)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HELP = Lock down special pages’ is closed to new replies.