WordPress.org

Ready to get started?Download WordPress

Forums

PHPBB Single Sign On
[resolved] Duplicate user fix (3 posts)

  1. Zeek20
    Member
    Posted 2 years ago #

    So I know the horrid error,

    Duplicate entry 'USER' for key 'username_clean [1062]

    everyone sees it if they don't enter their username right caps and all. I have a fix for it.
    Go into your auth_wpbb.php file located in your phpbb folder phpBB3/includes/auth/. Open it up with your favorite editor of choice and go down to,

    /*
    
             * * Exists in PHPBB ?
    
             */

    add this just below it,

    $username = strtolower($username);

    and change

    $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
    
                    FROM ' . USERS_TABLE . "
    
                    WHERE username = '" . $db->sql_escape($username) . "'";

    to

    $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
    
                    FROM ' . USERS_TABLE . "
    
                    WHERE username_clean = '" . $db->sql_escape($username) . "'";

    That should do it, now this will only work as long as you already had it logging you in with the correct username and that you could login on the WP side and be logged in on the phpBB side.

    http://wordpress.org/extend/plugins/phpbb-single-sign-on/

  2. onigoetz
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for your fix !

    I included it in version 0.8.6 of the plugin

  3. Zeek20
    Member
    Posted 2 years ago #

    No problem, I'm glad I was able to help. :)

    Edit: Just downloaded it and installed the new files over mine, works like a charm!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic