Active directory user name doesn't match Postie admin name.
-
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.
<td> <select name="postie-settings[admin_username]" id="postie-settings[admin_username]"> <?php $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>"; } ?> </select> </td>
- The topic ‘Active directory user name doesn't match Postie admin name.’ is closed to new replies.