The only solution I have at the moment is not perfect. Basically what happens is the RealDolmen plugin authenticates the user and if they don’t exist in the WordPress database it will create a new user. This in itself seems to interrupt ADI and therefore does not automatically lookup the user in AD, simply unhooking the create user function doesn’t make it work either.
So I had to find another way. One thing I noticed when users are created using the RealDolmen plugin, the user account in the WordPress dashboard is not flagged as an ADI user, therefore when performing a bulk import using ADI it would not fetch the details back. Next I added a new line to the end of the RealDolmen plugin under the last function iisauth_create_wp_user(), here’s my code:
function iisauth_create_wp_user($username)
{
$userData = array(
'user_pass' => microtime(),
'user_login' => $username,
'user_nicename' => $username,
'user_email' => $username . '@localhost',
'display_name' => $username,
'first_name' => $username,
'last_name' => $username,
'role' => 'subscriber'
) ;
$id = wp_insert_user($userData);
update_user_meta($id, 'adi_samaccountname', $username);
}
This will save an additional piece of user meta when the account is created by the RealDolmen plugin. What you can then do is have a cron job run periodically to bulk import users, the ADI plugin will then fetch attributes for your users from AD.
Like I said, it’s not ideal but it does work, but note there will be a period of time when a new user won’t have any attributes in your WordPress database.
Hope this helps you out.