summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-10-09 07:20:45 +0000
committerDries Buytaert <dries@buytaert.net>2006-10-09 07:20:45 +0000
commit03299556f930a5356a60798f6f2bdc552172b2e5 (patch)
tree59881f124a75a05c5d3f53fd40df3a5423bc2a72 /modules
parent6e8a0a16023e3af72e5b42d3e6e7b6cd6c3bc512 (diff)
downloadbrdo-03299556f930a5356a60798f6f2bdc552172b2e5.tar.gz
brdo-03299556f930a5356a60798f6f2bdc552172b2e5.tar.bz2
- Patch #69985 by Tobias: user/login shouldn't be accessible for authenticated users.
Diffstat (limited to 'modules')
-rw-r--r--modules/user/user.module12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 8e0323770..b4271e4f0 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -697,11 +697,11 @@ function user_menu($may_cache) {
// Registration and login pages.
$items[] = array('path' => 'user/login', 'title' => t('log in'),
- 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), 'type' => MENU_DEFAULT_LOCAL_TASK);
+ 'callback' => 'drupal_get_form', 'callback arguments' => array('user_login'), 'access' => !$user->uid, 'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'user/register', 'title' => t('create new account'),
- 'callback' => 'drupal_get_form', 'callback arguments' => array('user_register'), 'access' => $user->uid == 0 && variable_get('user_register', 1), 'type' => MENU_LOCAL_TASK);
+ 'callback' => 'drupal_get_form', 'callback arguments' => array('user_register'), 'access' => !$user->uid && variable_get('user_register', 1), 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'user/password', 'title' => t('request new password'),
- 'callback' => 'drupal_get_form', 'callback arguments' => array('user_pass'), 'access' => $user->uid == 0, 'type' => MENU_LOCAL_TASK);
+ 'callback' => 'drupal_get_form', 'callback arguments' => array('user_pass'), 'access' => !$user->uid, 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'user/reset', 'title' => t('reset password'),
'callback' => 'drupal_get_form', 'callback arguments' => array('user_pass_reset'), 'access' => TRUE, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'user/help', 'title' => t('help'),
@@ -771,7 +771,7 @@ function user_menu($may_cache) {
}
$items[] = array('path' => 'logout', 'title' => t('log out'),
- 'access' => $user->uid != 0,
+ 'access' => $user->uid,
'callback' => 'user_logout',
'weight' => 10);
}
@@ -900,6 +900,10 @@ function user_login($msg = '') {
'#attributes' => array('tabindex' => '2'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Log in'), '#weight' => 2, '#attributes' => array('tabindex' => '3'));
+
+ // We set the action to 'user' because 'user/login' is no longer accessible once logged in:
+ $form['#action'] = url('user');
+
return $form;
}