Fork me on GitHub

next_ad_int_user

after_enable

next_ad_int_user_after_enable (WP_User $wpUser, bool $isRestored);

Hook after user has been enabled.

Description

After the user has been enabled this hook is called.

Parameters

WP_User $wpUser

Enabled user object

bool $isRestored

Is true if the user has been previously been marked as disabled and is now enabled. You have to re-lookup the user's data to get the new email address.

after_disable

next_ad_int_user_after_disable (WP_User $wpUser);

Hook after user has been disabled.

Description

After the user has been disabled this hook is called.

Parameters

WP_User $wpUser

Disabled user object

user_create_email

next_ad_int_user_create_email(WP_User $wpUser, string $email);

since 2.1.9 (ADI-691) The filter is executed when a new email should be created if Duplicate email prevention is set to Create.

Description

By default, a new address is only created if Duplicate email prevention is set to Create and the given $wpUser has just been created or does already exist inside the WordPress database but has no email address. If you want to change this behavior, you can overwrite this by adding your own logic with a higher priority:

add_filter('next_ad_int_user_create_email', 'my_email_creator', 20, 2);
 
function my_email_creator($wpUser, $email) {
	// this creates *always* a new email address
	return next_ad_int()->getUserHelper()->createUniqueEmailAddress($email);
}

Parameters

WP_User $wpUser

WP_User whose email has to be set

string $email

E-mail retrieved from Active Directory

after_create

next_ad_int_user_after_create (NextADInt_Adi_User $adiUser, boolean $syncToWordPress = false, $writeUserMeta = true);

This hook is called after a new user has been created but before any updates (password, email etc.) has been made.

Description

The creation could have been triggered by a normal login, an execution of Test authentication or Sync to WordPress.

Parameters

NextADInt_Adi_User $adiUser

Previously created user. You can get its WordPress user id by accessing

$adiUser->getId()
boolean $syncToWordPress = false

Flag if the creation has been triggered by Sync to WordPress.

boolean $writeUserMeta = true

Flag if the user's Active Directory meta data should be written back to WordPress.

before_update

next_ad_int_user_before_update(NextADInt_Adi_User $adiUser, boolean $syncToWordPress = false, $writeUserMeta = true);

This hook is called before any new value of the user gets written to the WordPress database.

Description

The hook is called after next_ad_int_user_after_create if the user has been previously created. The hook itself could have been triggered by a normal login, an execution of Test authentication or by Sync to WordPress.

Parameters

NextADInt_Adi_User $adiUser

User to be updated. You can get its WordPress user id by accessing

$adiUser->getId()

The user's LDAP attributes can be retrieved by accessing

$ldapAttributes = $adiUser->getLdapAttributes();
// or
// $rawLdapAttributes = $adiUser->getLdapAttributes()->getRaw();
boolean $syncToWordPress = false

Flag if the creation has been triggered by Sync to WordPress.

boolean $writeUserMeta = true

Flag if the user's Active Directory meta data should be written back to WordPress.

after_update

next_ad_int_user_after_update(NextADInt_Adi_User $adiUser, WP_User $wpUser, boolean $syncToWordPress = false, $writeUserMeta = true);

This hook is called after all updates of the user's data got written to the WordPress database.

Description

The hook is called after next_ad_int_user_before_update and only if all previous updates (set email, update password etc.) have succeeded.

Parameters

NextADInt_Adi_User $adiUser

The user which has been updated. You can get its WordPress user id by accessing

$adiUser->getId()

The user's LDAP attributes can be retrieved by accessing

$ldapAttributes = $adiUser->getLdapAttributes();
// or
// $rawLdapAttributes = $adiUser->getLdapAttributes()->getRaw();
WP_User $wpUser

The WordPress user instance of the updated user containing the latest data.

boolean $syncToWordPress = false

Flag if the creation has been triggered by Sync to WordPress.

boolean $writeUserMeta = true

Flag if the user's Active Directory meta data should be written back to WordPress.