[buddypress-trac] [BuddyPress] #4199: Improve the logic of bp_core_login_redirect()

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri May 11 19:16:53 UTC 2012


#4199: Improve the logic of bp_core_login_redirect()
--------------------------+-----------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  1.6
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------
 The function `bp_core_login_redirect()` is intended to prevent users from
 being redirected to the Dashboard after logging in. This works well for
 many BP use cases, as most users never need to see the Dashboard. However,
 it can be quite annoying for users who *do* need to see the Dashboard,
 such as Administrators, because (for example) WP email notifications of
 things like pending comments contain direct links to wp-admin pages.
 Moreover, some BP sites run plugins that require users to have regular
 access to the Dashboard.

 My suggested solution is in the attached patch. It does the following:

 - login_redirect gets processed twice in a normal login: once when wp-
 login.php is rendered, and again just after login succeeds. Filtering both
 instances means any check for the current user will fail on the first
 instance of the filter, and the redirect_to parameter will be wiped out.
 I've refactored so that BP only modifies login_redirect after a successful
 login (which is the only time it matters anyway).
 - Allow the logged-in user to access the Dashboard with the cap
 'edit_posts' (Contributors or greater)
 - Introduce a filter bp_core_login_redirect, which will allow plugin
 authors to make exceptions to our rules without unhooking our function
 altogether

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4199>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list