summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-04-04 07:46:02 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-04-04 07:46:02 +0000
commit3e9948e529cbbb2c7f8c62de2be407b54e06755e (patch)
treeb5d33b2b8cf8319736b7607bd24b789b6e1bcdae /includes
parent4c3fe45fe93ade54513c8fdebde64e27b459e6b0 (diff)
downloadbrdo-3e9948e529cbbb2c7f8c62de2be407b54e06755e.tar.gz
brdo-3e9948e529cbbb2c7f8c62de2be407b54e06755e.tar.bz2
#55869: Redirect back to requested page after log-in
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc14
-rw-r--r--includes/menu.inc4
2 files changed, 14 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc
index e3e65528f..77c64ed90 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -255,6 +255,11 @@ function drupal_not_found() {
drupal_set_header('HTTP/1.0 404 Not Found');
watchdog('page not found', t('%page not found.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING);
+ // Keep old path for reference
+ if (!isset($_REQUEST['destination'])) {
+ $_REQUEST['destination'] = $_GET['q'];
+ }
+
$path = drupal_get_normal_path(variable_get('site_404', ''));
if ($path && $path != $_GET['q']) {
menu_set_active_item($path);
@@ -262,7 +267,7 @@ function drupal_not_found() {
}
else {
// Redirect to a non-existant menu item to make possible tabs disappear.
- menu_set_active_item('#');
+ menu_set_active_item('');
}
if (empty($return)) {
@@ -278,6 +283,11 @@ function drupal_access_denied() {
drupal_set_header('HTTP/1.0 403 Forbidden');
watchdog('access denied', t('%page denied access.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING, l(t('view'), $_GET['q']));
+ // Keep old path for reference
+ if (!isset($_REQUEST['destination'])) {
+ $_REQUEST['destination'] = $_GET['q'];
+ }
+
$path = drupal_get_normal_path(variable_get('site_403', ''));
if ($path && $path != $_GET['q']) {
menu_set_active_item($path);
@@ -285,7 +295,7 @@ function drupal_access_denied() {
}
else {
// Redirect to a non-existant menu item to make possible tabs disappear.
- menu_set_active_item('#');
+ menu_set_active_item('');
}
if (empty($return)) {
diff --git a/includes/menu.inc b/includes/menu.inc
index 730094b29..ee1fe0b43 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -428,8 +428,8 @@ function menu_set_active_item($path = NULL) {
static $stored_mid;
$menu = menu_get_menu();
- if (is_null($stored_mid) || !empty($path)) {
- if (empty($path)) {
+ if (!isset($stored_mid) || isset($path)) {
+ if (!isset($path)) {
$path = $_GET['q'];
}
else {