We are using a custom external login module to authenticate users on a new system. Basically converting a current Drupal 7 website using LoginToboggan already in use to a new version that uses all the same code with the exception of using a 3rd party user database. Everything is working fine but the "login successful message" was displaying 3 times. I managed to narrow it down to the LoginToboggan in the logintoboggan_user_login() function where it sets the message. The $repeat parameter is not set. So I'm guessing the user_login function is getting triggered several times while logging in the user with the external database and each time the function is triggered, logintoboggan_user_login sets the message again.
I tested this out and when I set $repeat to FALSE in the LoginToboggan module, the "login successful message" does not repeat anymore.
Before code
/**
* Implement hook_user_login().
*/
function logintoboggan_user_login(&$edit, $account) {
if (variable_get('logintoboggan_login_successful_message', 0)) {
drupal_set_message(theme('lt_login_successful_message', array('account' => $account)));
}
}
After code:
/**
* Implement hook_user_login().
*/
function logintoboggan_user_login(&$edit, $account) {
if (variable_get('logintoboggan_login_successful_message', 0)) {
drupal_set_message(theme('lt_login_successful_message', array('account' => $account)), 'status', FALSE);
}
}
I think this drupal_set_message() should be tweaked to set the $repeat to FALSE so the login message never repeats no matter the source.