WordPress.org

Ready to get started?Download WordPress

Forums

Password protect entire blog? (Authenticate plugin not working) (5 posts)

  1. 3stripe
    Member
    Posted 8 years ago #

    Hey folks,

    I need to password protect my whole blog - have tried 'sumans-authenticated-wordpress-plugin' but it seems to have some bugs with wp1.5...

    Is there any other way to do this (apart from .htaccess)

    Cheers,

    James

    function ac_auth_redirect() {
    // Checks if a user is logged in, if not redirects them to the login page
    if ( (!empty($_COOKIE[USER_COOKIE]) &&
    !wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true)) ||
    (empty($_COOKIE[USER_COOKIE])) ) {
    nocache_headers();
    header("HTTP/1.1 302 Moved Temporarily");
    header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
    header("Status: 302 Moved Temporarily");
    exit();
    }
    }
    if('wp-login.php' != $pagenow && 'wp-register.php' != $pagenow) add_action('template_redirect', 'ac_auth_redirect');
    ?>

  2. Kafkaesqui

    Posted 8 years ago #

  3. 3stripe
    Member
    Posted 8 years ago #

    Cheers Kafka, didn't spot those

    :-)

    Thanks,

    James

  4. 3stripe
    Member
    Posted 8 years ago #

    I have a slight problem - if I active the registered-only plugin, my feed is inaccessible if you're not logged in.

    Normally this makees sense of course - but I've got a flash site using the News category from my WordPress install - so I would like the rss feed for this feed to still be visible to the outside world...

    Is there a way I can do this, maybe by recreating the rss file on the root directory? Or some other way? (The flash website can still see the News fine because it hooks directly in to the database)

    Cheerio,

    James

  5. ColourDreamer
    Member
    Posted 8 years ago #

    My Word Press (1.5) isn't recognizing the registered-only, the plugin mentioned in the other post doesn't work, and the bit of code does not work.

    Oh I think I downloaded this plugin incorrectly, hold on.

    Yes, I did.

Topic Closed

This topic has been closed to new replies.

About this Topic