diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-10-25 16:41:35 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-10-25 16:41:35 +0000 |
commit | 61c8e5b01a80f9a4c2b22a2fd75af291da03fc25 (patch) | |
tree | 04df20a2c73bbb0d54d903ef297a0ea28bd8040c /modules | |
parent | 860b79b6446e0cd60f7e93a7be96c3ce94a668b0 (diff) | |
download | brdo-61c8e5b01a80f9a4c2b22a2fd75af291da03fc25.tar.gz brdo-61c8e5b01a80f9a4c2b22a2fd75af291da03fc25.tar.bz2 |
- Patch #88474 by chx, webernet, etc: fixed 'access denied' problem
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user/user.module | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 1cd124bea..fdabe95d4 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -689,13 +689,17 @@ function user_menu($may_cache) { $view_access = user_access('access user profiles'); if ($may_cache) { - $items[] = array('path' => 'user', 'title' => t('User account'), - 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), 'access' => TRUE, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'user', 'title' => t('user account'), + 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), + 'access' => !$user->uid, 'type' => MENU_CALLBACK); $items[] = array('path' => 'user/autocomplete', 'title' => t('User autocomplete'), 'callback' => 'user_autocomplete', 'access' => $view_access, 'type' => MENU_CALLBACK); // Registration and login pages. + $items[] = array('path' => 'user/login', 'title' => t('log in'), + 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), + 'access' => !$user->uid, 'type' => MENU_DEFAULT_LOCAL_TASK); $items[] = array('path' => 'user/login', 'title' => t('Log in'), 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), 'access' => TRUE, 'type' => MENU_DEFAULT_LOCAL_TASK); $items[] = array('path' => 'user/register', 'title' => t('Create new account'), @@ -779,6 +783,12 @@ function user_menu($may_cache) { // Add the CSS for this module. We put this in !$may_cache so it is only // added once per request. drupal_add_css(drupal_get_path('module', 'user') .'/user.css', 'core'); + if ($_GET['q'] == 'user' && $user->uid) { + // We want to make the current user's profile accessible without knowing + // their uid, so just linking to /user is enough. To achieve this goal, + // we do an internal redirect. + menu_set_active_item('user/'. $user->uid); + } if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) { $account = user_load(array('uid' => arg(1))); |