Skip to:
Content
Pages
Categories
Search
Top
Bottom

User names, @mentions, full-stops/periods, LDAP

  • Avatar of richarddavis
    Richard.Davis
    Member

    @richarddavis

    WP 2.9.2 (not MU) + BP 1.2

    Some quirky problem around user names.

    We’re using Simple LDAP plugin and user IDs are therefore being set from our AD, which has a standard format

    FirstName.Lastname

    I noticed that the URLs of BP profile pages were being generated wrongly. Instead of

    members/FirstName.LastName

    it was replacing the full-stop with a space, so

    members/FirstName LastName

    naturally didn’t work in a HREF

    However hacking the URL in the location bar to

    members/FirstName%20LastName

    did arrive at the intended profile page.

    We couldn’t work out exactly how BP was handling this sanitizing of usernames, but a quick

    s/ /./

    in bp_core_get_user_domain did the trick and now the links work fine.

    This hack isn’t ideal, of course. Another side effect, probably related, is that @mentions also don’t seem to work. The ‘unique identifier’ specified by BP also contains a space:

    @Firstname Lastname is a unique identifier for …

    Naturally with the space in it, it isn’t, and of course @mentions in BP updates don’t work.

    Thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you set this in wp-config.php? It may go some way to assisting.

    define( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’, true );

    From http://codex.buddypress.org/how-to-guides/changing-internal-configuration-settings/

    Avatar of richarddavis
    Richard.Davis
    Member

    @richarddavis

    Thanks for the quick tip Paul, that seems to address the problem we originally hacked it for, and BP profile links now seem better without the hack.

    However the @mentions still don’t work for any names with a period in them. They are fine for @admin (the only username without a period).

    I saw somewhere else that punctuation immediately following an @name messes it up – sounds like it could be related to this problem. BP may need some better regexes if it’s going to support periods in @usernames?

    (Wish we didn’t have the stupid periods, but that’s what the Windows guys have left us with!)

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.