[resolved] Active directory user name doesn't match Postie admin name. (3 posts)

  1. emile.swain
    Posted 3 years ago #

    I activate my users by using Active directory, as such the structure of the users user_login name is not the same as that used by wordpress and subsequently postie, both of which use the value created by $user->user_nicename.

    The conflict arrises when postie checks to see if the postie admin users is a valid wordpress user. It fails because my user_login names use a . instead of a - separator.

    In the settings panel postie sets the $config['admin_user'] to $user->user_nicename. Nice name being: firstname +"-"+surname i.e. joe-blogs.

    Then when checking the user it uses:

    $adminuser = get_user_by('login', $config['admin_username']);

    This however is searching for a user by the users "login name". Which in my case fails because the user_login is not set by wordpress but instead active directory, hence it isn't the same structure.

    The solution was to edit the config_form.php file and change the dropdown boxes value setting to return the users login name and not nicename.

                                <select name="postie-settings[admin_username]" id="postie-settings[admin_username]">
                                    $adminusers = get_users("orderby=nicename&role=administrator");
                                    foreach ($adminusers as $user) {
                                        $selected = "";
                                        if ($user->user_login == $admin_username) {
                                            $selected = " selected=\"selected\"";
                                        echo "<option value=\"$user->user_login\"$selected>$user->user_nicename</option>";


  2. nunovo
    Posted 3 years ago #

    does that mean I'll get a similar failure if my username is Winter but my nickname is wntr? Postie seems to think my nickname is the admin username.

  3. Wayne Allen
    Plugin Author

    Posted 3 years ago #

    Thanks for reporting this bug. I've fixed it in 1.5.9.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Postie
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.