--- a/logintoboggan.module 2015-05-01 18:53:30.000000000 +0300 +++ b/logintoboggan.module 2018-02-01 19:13:37.000000000 +0200 @@ -1028,28 +1028,33 @@ function logintoboggan_process_login($account, &$edit, $redirect = array()){ global $user; + // restrict logintoboggan module do anything in case user is already logged in. + // It breaks panel pages with user login block (admin view). + if (!empty($account->uid) || $user->uid == 0) { + $user = user_load($account->uid); + user_login_finalize($edit); + // In the special case where a user is validating but they did not create their + // own password, show a user message letting them know to change their password. + if (variable_get('user_email_verification', TRUE)) { + watchdog('user', 'User %name used one-time login link at time %timestamp.', array( + '%name' => $user->name, + '%timestamp' => REQUEST_TIME + )); + drupal_set_message(t('You have just used your one-time login link. It is no longer possible to use this link to login. Please change your password.')); + } - $user = user_load($account->uid); - user_login_finalize($edit); - - // In the special case where a user is validating but they did not create their - // own password, show a user message letting them know to change their password. - if (variable_get('user_email_verification', TRUE)) { - watchdog('user', 'User %name used one-time login link at time %timestamp.', array('%name' => $user->name, '%timestamp' => REQUEST_TIME)); - drupal_set_message(t('You have just used your one-time login link. It is no longer possible to use this link to login. Please change your password.')); - } + if (isset($redirect[0]) && $redirect[0] != '') { + return $redirect; + } - if (isset($redirect[0]) && $redirect[0] != '') { - return $redirect; + return array( + 'user/' . $user->uid, + array( + 'query' => array(), + 'fragment' => '', + ), + ); } - - return array( - 'user/'. $user->uid, - array( - 'query' => array(), - 'fragment' => '', - ), - ); } function logintoboggan_eml_validate_url($account, $url_options){