Skip to:
Content
Pages
Categories
Search
Top
Bottom

Always login


  • Null
    Member

    @null

    Is it possible to let users always have to login each time the visit the forum?

    So if they leave the page/forum they will be auto signed out. When they return or start up their browser and visit the forum, they’ll have to login again.

    Perhaps something with cookies that they will use a cookie for 1 session only?

    Sec, how can I make it so that the users will always see register.php first if they want to login instead of the forum frontpage? (i have an idea about this, using the .htaccess file, but perhaps there are other options)

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

  • so1o
    Member

    @so1o

    i think you can do this by overridding the bb_cookie function and replacing it with

    function bb_cookie( $name, $value, $expires = 0 ) {

    if ( bb_get_option( ‘cookiedomain’ ) )

    setcookie( $name, $value, 0, bb_get_option( ‘cookiepath’ ), bb_get_option( ‘cookiedomain’ ) );

    else

    setcookie( $name, $value, 0, bb_get_option( ‘cookiepath’ ) );

    }


    Null
    Member

    @null

    Can this be used as a plugin? The real questions should be: Can you overide normal bbpress functions with a plugin? And if so, how would this plugin look like?

    And can a function like this be added:

    If user logged-in = false -> redirect to login.php (or register.php)


    fel64
    Member

    @fel64

    I think bb_cookie is in pluggable.php, so yes. Just look for wordpress documentation on overwriting functions like this (achieveable through plugins).

    Also easy. :)

    add_action('bb_init', 'chuck_out_lusers');
    function chuck_out_lusers() {
    if( !bb_get_current_user() && bb_get_location != 'login-page' ) {
    header('Location: http://blah.example.com/bb-login.php');
    exit;
    }
    }

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

You must be logged in to reply to this topic.