Support » Plugin: PHPBB Single Sign On » [Plugin: PHPBB Single Sign On] Duplicate user fix

  • Resolved Zeek20

    (@zeek20)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author onigoetz

    (@onigoetz)

    Thanks for your fix !

    I included it in version 0.8.6 of the plugin

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: PHPBB Single Sign On] Duplicate user fix’ is closed to new replies.