Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3e9948e5
Commit
3e9948e5
authored
Apr 04, 2006
by
Steven Wittens
Browse files
#55869
: Redirect back to requested page after log-in
parent
4c3fe45f
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
3e9948e5
...
...
@@ -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
))
{
...
...
includes/menu.inc
View file @
3e9948e5
...
...
@@ -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
(
!
is
set
(
$stored_mid
)
||
isset
(
$path
))
{
if
(
!
isset
(
$path
))
{
$path
=
$_GET
[
'q'
];
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment