The BuddyPress Profile Photo extension converts the Active Directory attributes thumbnailPhoto, jpegPhoto and thumbnailLogo into a BuddyPress profile photo.

Requirements

You need Next Active Directory Integration installed and already configured.

Usage

  • Download the premium extension

  • Copy the extracted ZIP file into your wp-content/plugins directory

  • Activate the plug-in in your WordPress plug-in view

  • Make sure that you have mapped the field thumbnailPhoto, jpegPhoto or thumbnailLogo in Next ADI. Please get in touch with your AD administrator to pick the right attribute. Configure the mapping on the Attributes tab:

    NADI Extension: BuddyPress Profile Photo - Mapping
  • Save the mapping. With the next login of the user or the next Sync to WordPress run the user's profile picture gets updated.

FAQ

What happens if I map more than one AD photo attribute?

The extension checks the attributes in the order of thumbnailPhoto, jpegPhoto, thumbnailLogo. The first attribute containing atleast one byte is used.

What happens if the attribute does not contain a valid photo?

The extension will fail. Please let your AD administrator know that the user has invalid photo data.

How can I adjust the BudyPress avatar size ?

You can edit the BuddyPress avatar size in the following file "wp-content/plugins/buddypress/bp-core/bp-core-avatars.php". If your Active Directory profile pictures have a size of 64x64px you have to change the following lines.

if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
define( 'BP_AVATAR_THUMB_WIDTH', 64 );

if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
define( 'BP_AVATAR_THUMB_HEIGHT', 64 );

if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
define( 'BP_AVATAR_FULL_WIDTH', 64 );

if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
define( 'BP_AVATAR_FULL_HEIGHT', 64 );

BuddyPress crops the avatar images from the Active Directory. How can I disable the cropping of avatars?

BuddyPress crops all images by default, so this is not exactly a NADI-related questions. Open a file which is automatically picked up by WordPress, e.g.:

  • the file wp-content/themes/${MY_THEME}/functions.php
  • or create a new file wp-content/plugins/bp-disable-crop/index.php and enable the plug-in after you have added the code snippet

Put the following code snippet into the file

function disable_bp_crop($a, $b) {
	return false;
}

add_filter('bp_core_pre_avatar_handle_crop', 'disable_bp_crop', 5, 2);