=== modified file 'modules/user/user.module' --- modules/user/user.module 2008-05-26 17:12:54 +0000 +++ modules/user/user.module 2008-05-30 20:58:37 +0000 @@ -81,6 +81,10 @@ function user_theme() { 'user_signature' => array( 'arguments' => array('signature' => NULL), ), + 'user_no_cookie' => array( + 'file' => 'user.pages.inc', + 'arguments' => array('domain' => NULL), + ), ); } @@ -943,6 +947,13 @@ function user_menu() { 'access callback' => 'user_is_anonymous', 'type' => MENU_LOCAL_TASK, ); + $items['user/no-cookie'] = array( + 'title' => 'Please enable cookies', + 'page callback' => 'user_no_cookie', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + 'file' => 'user.pages.inc', + ); $items['user/reset/%/%/%'] = array( 'title' => 'Reset password', 'page callback' => 'drupal_get_form', @@ -1344,7 +1355,10 @@ function user_login_submit($form, &$form global $user; if ($user->uid) { $form_state['redirect'] = 'user/' . $user->uid; - return; + } + elseif (!$_COOKIE) { + unset($_REQUEST['destination']); + drupal_goto('user/no-cookie'); } } === modified file 'modules/user/user.pages.inc' --- modules/user/user.pages.inc 2008-04-14 17:48:33 +0000 +++ modules/user/user.pages.inc 2008-05-30 20:56:13 +0000 @@ -363,3 +363,11 @@ function user_page() { return drupal_get_form('user_login'); } } + +function user_no_cookie() { + return theme('user_no_cookie', ini_get('session.cookie_domain')); +} + +function theme_user_no_cookie($domain) { + return t('It seems that your browser does not accept cookies. To log into this site, you need to accept cookies from the domain @domain.', array('@domain' => $domain)); +}