Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Synchronization of usernames

This discussion is related to the Vanilla jsConnect addon.

We use jsconnect and orchid to do SSO between Drupal and Vanilla. Our problem is that we have different usernames on either side. In Drupal members log in with their member id, always a 6 digit number. In Vanilla they can pick whatever forum username they want.

Our problem is that whenever you log in with SSO the usename in Vanilla is overwritten by the username in Drupal.

Any way to avoid this?

Running Vanilla 2.1.8 and jsconnect 1.4.4

Comments

  • hgtonighthgtonight ∞ · New Moderator

    I do not think this functionality comes out of the box in jsConnect. You should be able to do it by modifying Orchid to not pass the 'name' field.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Thanks for the suggestion but i think orchid needs to pass the name field to match users.
    Need to figure out why or how jsconnect updates the username in vanilla to match it.

  • If you want a quick fix.

    In class.entrycontroller.php, look for this line

    // Synchronize the user's data.
    $UserModel->Save($Data, array('NoConfirmEmail' => TRUE, 'FixUnique' => TRUE, 'SaveRoles' => $SaveRoles));

    And add this above it

            if (!empty($User["Name"])) {
                $Data["Name"] = $User["Name"];
            }
    

    This will populate the name if the name is empty, but will not overwrite it if the user has changed their name.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Did anyone ever confirm that this works?

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Never mind, it doesn't. Can't get the plugin to enable.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    I'm an idiot. There's an extra 'i' in line 1 of the pasted code ( 'idefined()' instead of 'defined()').

    Also, I just tested it out - logged in with G+ and it did not change my username! Thank you!

    R_Jhgtonight
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @hgtonight or @whu606
    Could you please change the first line in my code above to be simply <?php? Thanks!

    AaronWebstey
Sign In or Register to comment.