Remove helper functions for assessing the state of the `wp_signups` table, as they are no longer used in multiple places. Instead, suppress errors and always query for the existence of the table and `signup_id` column before attempting to upgrade or install. See #5563. Props r-a-y. (trunk)

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8313 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve the migration tool that converts old non-multisite signups to post-2.0 system

This refactoring involves a number of improvements:

- Old signups are identified as those users with user_status=2, instead of
  those users with an 'activation_key' usermeta value. Use of the latter
  technique caused problems with upgrades when plugins had interfered in the
  normal BuddyPress registration flow in such a way as to retain the activation
  key on activated accounts. user_status=2 is a more reliable technique.
- Querying by user_status=2 means that the get_users() query does not have to
  include all usermeta, which makes for a more performant query on large sites.
- The migration routine has been broken out into a separate function
  bp_members_migrate_signups(), and unit tests have been written for it.
- Activation keys are now regenerated for migrated users who did not have an
  existing key in usermeta for some reason.

Fixes #5553

Props imath

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8315 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Ensure that existing 'description' is not wiped out when running groups_create_group() with an existing group

Fixes #5576

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8316 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improved documentation in Members component. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8318 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline documentation in Members component. See #5022.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8319 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Update bp_last_activity cache when fetching user last_activity.

The cache doesn't do much when it's not set :)

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8320 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix incorrect variable reference in last_activity test

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8321 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
xProfile: fix redirect when an admin uploads an avatar to another user's profile.

When cropping a new avatar, a redirect always took you to the logged-in user's profile.
This was fine in most situations, as a user can only update their own profile.
However, site admins are able to edit other users' profiles, so we need to redirect to the displayed user's profile.

Fixes #5580, props milesstewart88

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8322 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't attempt to overload add_root property in bp_core_add_root_component()

The add_root array is defined only for backward compatibility purposes in the
BuddyPress global object, and thus is overloaded rather than defined in the
constructor. This means that adding items directly to the array is forbidden
on recent versions of PHP. As a workaround, we add the item as a separate array
and then swap the array, which is allowed and will not result in notices.

Fixes #5588

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8323 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Check bp_disable_account_deletion() setting in screen function rather than bp_core_delete_account() business function

The purpose of the disable-account-deletion setting is to prevent normal (ie
non-admin) BP users from deleting their own accounts through the front-end
interface. Locating the settings check in the business function
bp_core_delete_account() therefore caused problems when deleting accounts in
areas that were not meant to be covered by the setting, such as when accounts
are deleted in the Dashboard by an admin, or when the BP_Signup::delete()
method is called. This caused a particular problem in BP 2.0, because the
deletion of signups was no longer correctly cleaning up other data from the
database (xprofile, usermeta, etc).

Fixes #5575

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8324 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add unit test for comparing subsequent calls to `BP_Core_User::get_last_activity()` to compare cached results to uncached results. See #5597, to test logic introduced in r8047.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8326 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Backwards compatibility for querying single groups via the `slug` argument. Props r-a-y. Fixes #5596. (trunk)

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8329 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove disable_account_deletion cases from bp_core_delete_account() tests

As of r8324, this settings check takes place in an action controller, not here
in the business level function. See #5575

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8330 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Overhaul caching for user last_activity values

The last_activity methods in the BP_Core_User class were originally designed
without persistent caching in mind. In r8047, some minimal caching support was
introduced, but it was tacked on and incomplete. In particular, it depended
on an inconsistent structure of return values from the last_activity methods.
See #5128 for more background.

This changeset introduces a number of changes that make last_activity methods
perform more consistently, as well as full support for object caching.

- BP_Core_User::get_last_activity() always returns a multidimensional array
  of last_activity arrays, keyed by user_id. This remains true even when
  last_activity data is being fetched only for a single user.
- last_activity data is stored in the bp_last_activity cache bucket without
  the user-id-keyed wrapper.
- BP_Core_User::get_last_activity() now uses the same caching technique as
  other BuddyPress and WordPress queries: detect which requested items are not
  yet in the cache, prime the cache for those items, and then fetch all
  requested values directly from the cache to build a return value.

Fixes #5590

Props imath, johnjamesjacoby for initial patches

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8332 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When migrating last_activity data, clear all data to avoid duplicates

Previously, duplicates were avoided with a NOT IN subquery. But this caused
load problems on large installations, where the subquery would return
many thousands of results.

Fixes #5572

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8333 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve layout of Welcome screen, for greater consistency across browsers and WP versions

Fixes #5561

Props mercime

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8334 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improved documentation in Members component. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8335 cdf35c40-ae34-48e0-9cc9-0c9da1808c22