Integration with Gnuboard Completed

Integration with Gnuboard Completed

Based on the WordPress member database, we have integrated it with Gnuboard to allow users to write posts upon logging in to the board.

  1. Subdomain and cookie sharing
  2. Save the following source code as “wp-sso.php” on the server where WordPress is installed
    [PHP] include 'wp-load.php';
    $cookie_name = 'wordpress_logged_in_'.md5(get_site_option('siteurl'));
    $cookie = $_COOKIE[$cookie_name];
    wp_set_current_user(wp_validate_auth_cookie($cookie, 'logged_in'));
    if($user = wp_get_current_user())
    {
    echo '‘.$user->user_login.’‘;
    //echo ‘‘.$user->user_nicename.’‘;
    echo ‘‘.$user->display_name.’‘;
    echo ‘‘.$user->user_email.’‘;
    echo ‘‘.$user->user_url.’‘;
    }
    ?>[/PHP]
  3. If there is no Gnuboard session value and a WordPress cookie value exists, the server processes module 2 to implement SSO (Single Sign On) functionality.
  4. If there is a Gnuboard session value and no WordPress cookie value, clear the session and refresh the page.
  5. When a Gnuboard page loading event occurs, resize the page accordingly.

 

 

Comments (2)

Leave a Reply

이메일 주소는 공개되지 않습니다. (* 질문, 건의사항 등은 "질문게시판"을 이용해주세요)