Commit 95799751 authored by Dries's avatar Dries
Browse files

- Patch #172765 by webchick and chx: path 'user' returns 403

parent 7a0d380f
......@@ -890,9 +890,8 @@ function user_menu() {
// Registration and login pages.
$items['user'] = array(
'title' => 'Log in',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_login'),
'access callback' => 'user_is_anonymous',
'page callback' => 'user_page',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
......@@ -1130,6 +1129,23 @@ function user_set_authmaps($account, $authmaps) {
}
}
/**
* Access callback for path /user.
*
* Displays user profile if user is logged in, or login form for anonymous
* users.
*/
function user_page() {
global $user;
if ($user->uid) {
$_GET['q'] = 'user/'. $user->uid;
return menu_execute_active_handler();
}
else {
return drupal_get_form('user_login');
}
}
function user_login(&$form_state, $msg = '') {
global $user;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment