diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-06-24 05:07:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-06-24 05:07:55 +0000 |
commit | 3468310a61399a67b75753e179e328389f73bd93 (patch) | |
tree | ddd78a718039b5eb8b27844f12cb62628349ae80 /modules | |
parent | 9f4a33588791c51a447026154d0319c4b2d9dee4 (diff) | |
download | brdo-3468310a61399a67b75753e179e328389f73bd93.tar.gz brdo-3468310a61399a67b75753e179e328389f73bd93.tar.bz2 |
- Patch #8778 by Morbus Iff: with the tabs patch, user/login, user/register, and user/password now show all three forms, as opposed to just the requested relevance. The attached patch implements a quick workaround: three new callbacks, and a cheapy modification of user_page where I use a ternary to test whether arg(2) exists (as it would in the case of user/nnn/edit). If it does, we set that to $op, and if it doesn't (in the case of user/login, etc.), we set arg(1).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user.module | 8 | ||||
-rw-r--r-- | modules/user/user.module | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/modules/user.module b/modules/user.module index 7f93e0321..923805028 100644 --- a/modules/user.module +++ b/modules/user.module @@ -620,7 +620,11 @@ function user_menu() { 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); $items[] = array('path' => 'user/login', 'title' => t('log in'), - 'type' => MENU_CALLBACK); + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'user/register', 'title' => t('register'), + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'user/password', 'title' => t('request new password'), + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); $items[] = array('path' => 'admin/user', 'title' => t('users'), 'callback' => 'user_admin', 'access' => $access); @@ -1173,7 +1177,7 @@ function user_page() { $op = $_POST['op']; if (empty($op)) { - $op = arg(2); + $op = arg(2) ? arg(2) : arg(1); } switch ($op) { diff --git a/modules/user/user.module b/modules/user/user.module index 7f93e0321..923805028 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -620,7 +620,11 @@ function user_menu() { 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); $items[] = array('path' => 'user/login', 'title' => t('log in'), - 'type' => MENU_CALLBACK); + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'user/register', 'title' => t('register'), + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'user/password', 'title' => t('request new password'), + 'callback' => 'user_page', 'access' => TRUE, 'type' => MENU_CALLBACK); $items[] = array('path' => 'admin/user', 'title' => t('users'), 'callback' => 'user_admin', 'access' => $access); @@ -1173,7 +1177,7 @@ function user_page() { $op = $_POST['op']; if (empty($op)) { - $op = arg(2); + $op = arg(2) ? arg(2) : arg(1); } switch ($op) { |