Opened 11 years ago
Closed 11 years ago
#5042 closed enhancement (fixed)
Disable certain pages for logged-in users
Reported by: | henrywright | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | 1.7 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
I can't think of a reason why the lost password, login, register, activate, reset password pages etc should be available to logged-in users. If a logged in user attempts to access one of these pages then perhaps something should happen such as a redirect to the member's profile page?
Attachments (1)
Change History (7)
#2
@
11 years ago
- Keywords reporter-feedback added
Lost password and Register are WP pages, so it's not really within the scope of BP to redirect away from them.
I'm pretty sure it's already the case that logged-in users are redirected away from the Register and Activate pages. Can you double check that that's the case?
#3
@
11 years ago
Hi Boone
Thanks for the feedback. Ah yes, of course, the lost password and reset password pages fall under the WP remit.
I can confirm that the the register page redirects to the homepage. However, the activate page does not redirect. A logged-in user is shown the activation form which asks for an activation key.
May I suggest:
//redirect logged in users to profile function bp_redirect_activate_while_loggedin() { global $bp; if ( bp_is_activation_page() ) { wp_redirect( $bp->loggedin_user->domain ); exit(); } } add_action('wp','bp_redirect_activate_while_loggedin');
#5
@
11 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 1.9
Thanks for looking into it more, henrywright. Here's what we currently do with the register page: http://buddypress.trac.wordpress.org/browser/tags/1.7.2/bp-members/bp-members-screens.php#L58 I'm thinking we should do something similar in the Activate screen function, just to be consistent (that'd be bp_core_screen_activation()
). See 5042.patch.
This is how I am doing it. The conditional just checks for logged in users visiting the homepage but this could be changed or added to if necessary.