Support » Plugin: Postie » Active directory user name doesn't match Postie admin name.

  • Resolved emile.swain


    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>";

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    Plugin Author Wayne Allen


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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Active directory user name doesn't match Postie admin name.’ is closed to new replies.