diff --git a/modules/user.module b/modules/user.module index f6f3f1a53b9..05749c50503 100644 --- a/modules/user.module +++ b/modules/user.module @@ -923,8 +923,15 @@ function user_login_validate($form_id, $form_values) { function user_login_submit($form_id, $form_values) { global $user; if ($user->uid) { - // sometimes modules call this function during a bootstrap so we don't use t() here - watchdog('user', "Session opened for ". check_plain($user->name)); + // To handle the edge case where this function is called during a + // bootstrap, check for the existence of t(). + if (function_exists('t')) { + $message = t('Session opened for %name.', array('%name' => theme('placeholder', $user->name))); + } + else { + $message = "Session opened for ". check_plain($user->name); + } + watchdog('user', $message); // Update the user table timestamp noting user has logged in. db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $user->uid); diff --git a/modules/user/user.module b/modules/user/user.module index f6f3f1a53b9..05749c50503 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -923,8 +923,15 @@ function user_login_validate($form_id, $form_values) { function user_login_submit($form_id, $form_values) { global $user; if ($user->uid) { - // sometimes modules call this function during a bootstrap so we don't use t() here - watchdog('user', "Session opened for ". check_plain($user->name)); + // To handle the edge case where this function is called during a + // bootstrap, check for the existence of t(). + if (function_exists('t')) { + $message = t('Session opened for %name.', array('%name' => theme('placeholder', $user->name))); + } + else { + $message = "Session opened for ". check_plain($user->name); + } + watchdog('user', $message); // Update the user table timestamp noting user has logged in. db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $user->uid);