Hey @sovrgn,
Nice one for getting it working ??
Looks like it is a multisite issue.
What happens if someone resets their password from the profile page? Does it update the hash/salt on the external DB?
No. The system is designed for users who have an external system that is their ‘main source of truth’. The plugin just reads the latest data from there. One solution is to disable this feature for users or instead have the button redirect them to your other system.
I did start to look at this as a feature but it is not currently available.
This can be achieved however. In the WordPress hook that updates the database you could write a simple query to update the field.
You can even use the External Login plugin tools to access the data required for the connection. If you look in the FAQ for the details on available hooks you’ll see an example shown for the exlog_hook_action_authenticated
hook. It uses External Login to create a connection and delete a user from the external table when they are authenticated.
// Uses the data provided to the plugin to create the database object and data required for a query
$db_data = exlog_get_external_db_instance_and_fields('mysql');
// A query of your choice
$rows = $db_data["db_instance"]->delete(
esc_sql($db_data["dbstructure_table"]),
array( esc_sql($db_data["dbstructure_username"]) => esc_sql($exlog_user_data['user_login']) )
);
// Checking if the user was deleted
if ($rows) {
error_log('User Successfully deleted from external database');
} else {
error_log('Unable to delete user from external database');
}
You could do something similar in the update password hook that updates the database with a new password hash.
Does this help?