#2188 closed enhancement (fixed)
Redirect to the home page after logout from a private forum/topic/reply
Reported by: | alex-ye | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6.1 | Priority: | normal |
Severity: | normal | Version: | 2.2.3 |
Component: | Component - Users | Keywords: | commit |
Cc: | nashwan.doaqan@…, wordpress@…, jared@…, pippin@… |
Description
Hi bbPress Lovers , When the user logout from a private forum/topic/reply the WordPress redirect the page to 404 error page .
I think we should redirect it to the home page since the private forum/topic/reply are only shown for users .
I prepare some codes about that , but I am not sure that this is a thing should be in the core !
Attachments (4)
Change History (23)
#2
@
12 years ago
- Component changed from Code Improvement to General
- Type changed from defect to enhancement
#8
follow-up:
↓ 9
@
11 years ago
Also the code now is doing:
// Rejig the $redirect_to if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) { $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; } $redirect_to = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
That if doesn't make any sense, as the last line is overwriting $redirect_to.
#9
in reply to:
↑ 8
@
11 years ago
Replying to MZAWeb:
That if doesn't make any sense, as the last line is overwriting $redirect_to.
hhhh, I don't know what I was thinking about :D
I will update the patch soon..
#11
@
11 years ago
- Cc pippin@… added
Is there a function in bbPress for can_view( $post_id )
? If so, that would make this dramatically simpler.
#13
@
11 years ago
Sorry, but bbp_user_can_view_forum()
doesn't work! for this reasons:
1- A BUG: if you see the function source code the check bbp_is_user_keymaster()
doesn't use the $user_id variable.
I will open a another ticket about this now.
2- We need to check if the visitor can read the forum, so will need to pass the user_id => 0
and this will not work! because bbp_is_user_keymaster()
will fallback to the current user ID :(
So..
I think we should introduce some functions if we want a really clean solution, maybe something like bbp_user_can_view_topic()
and bbp_user_can_view_reply()
and we should add a fourth argument in bbp_user_can_view_forum()
let's called it guest=>(bool)
What's your thoughts?!
#14
@
11 years ago
- Component changed from General to Users
- Keywords early added; has-patch removed
- Milestone changed from 2.5 to 2.6
Patch looks okay at a cursory glance. Let's move this to 2.6 early, and get it in to test right away.
#17
@
6 years ago
- Keywords commit added; needs-testing early removed
- Milestone changed from 2.8 to 2.7
Working on a different approach for 2.7 now.
This needs to happen in a few places; basically, the redirects need to be a bit smarter. Too late for 2.3, so moving to 2.4.