bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

(request) remember me plugins?

(4 posts)
  • Started 1 year ago by AstRonot
  • Latest reply from _ck_
  • This topic is not resolved
  1. I want to remember me plugins I don't find it.Thank you:)

    Posted 1 year ago #
  2. You want a what?

    Posted 1 year ago #
  3. I bet they mean like in wordpress where the cookie will be set for a year instead of a week?

    What's the bbpress cookie default, I'll have to go look at the code.

    I get around this problem by forcing the wp login from everywhere.

    There was another request for this feature here:
    http://bbpress.org/forums/topic/remember-me-option-at-login?replies=3

    Posted 1 year ago #
  4. Here's a horrible plugin hack to force year long cookies always, without an option for the user which will take more skill than me. Untested but in theory should work.

    <?php
    /*
    Plugin Name:  year long cookies
    Description:  bbpress cookie length fix - SAVE AS   "_cookieyear.php"  (without quotes but with leading underscore)
    Plugin URI:
    Author:
    Version: 1.0
    */ 
    
    if ( !function_exists('bb_login') ) :
    function bb_login($login, $password) {
    	if ( $user = bb_check_login( $login, $password ) ) {
    		bb_cookie( bb_get_option( 'usercookie' ), $user->user_login, time() + 31536000 );
    		bb_cookie( bb_get_option( 'passcookie' ), md5( $user->user_pass ) );
    		do_action('bb_user_login', (int) $user->ID );
    	}
    
    	return $user;
    }
    endif;
    
    if ( !function_exists('bb_cookie') ) :
    function bb_cookie( $name, $value, $expires = 0 ) {
    	if ( !$expires )
    		$expires = time() + 31536000;
    	if ( bb_get_option( 'cookiedomain' ) )
    		setcookie( $name, $value, $expires, bb_get_option( 'cookiepath' ), bb_get_option( 'cookiedomain' ) );
    	else
    		setcookie( $name, $value, $expires, bb_get_option( 'cookiepath' ) );
    }
    endif;
    
    ?>
    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.