Jump to content

Community

Developer Documentation

Other callbacks available to login handlers

Handling account changes

When a user changes their email, password or username on the community, your handler can be notified of these changes and update their databases. You need to implement the canChange() method to let the User CP controllers know you support this functionality, then implement the methods changeEmail()changePassword() and changeUsername() as appropriate.

 

boolean canChangestring $type, \IPS\Member $member )

Indicates whether this login handler will support the user changing their username, email address or password.

  • $type (string, required)
    The type of property that is changing (one of username, password or email)
  • $member (\IPS\Member, required)
    The relevant member whose details are changing

 

void changeEmail( \IPS\Member $member, string $oldEmail, string $newEmail )

Called when the user is changing their email address.

  • $member (\IPS\Member, required)
    The member changing their email address
  • $oldEmail (string, required)
    The user's current email address
  • $newEmail (string, required)
    The user's new email address

 

Other callbacks

void logoutAccount( \IPS\Member $member, \IPS\Http\Url $redirectUrl )

Called when a user logs out. Note this is not called if the administrator uses the 'force log-out all users' tool in the AdminCP.

  • $member (\IPS\Member, required)
    The member that is logging out
  • $redirectUrl (\IPS\Http\Url, required)
    A URL as an \IPS\Http\Url object to which the user will be redirected after logging out

 

void createAccount( \IPS\Member $member )

Called when a user's account is created.

  • $member (\IPS\Member, required)
    The member object for the new account.

 

void validateAccount\IPS\Member $member )

Called when a user validates their account. Never called if account validation is disabled. If email validation is enabled, this is called after a user validates their email address or if the admin manually validates the account. If admin validation is enabled, this is called after the admin has validated the account.

  • $member (\IPS\Member, required)
    The member object for the account that has been validated.

 

void deleteAccount( \IPS\Member $member )

Called when the user account is deleted by an administrator.

  • $member (\IPS\Member, required)
    The member being deleted.

 

void banAccount( \IPS\Member $member, boolean $ban=TRUE )

Called when a user account is banned or unbanned.

  • $member (\IPS\Member, required)
    The member account being banned or unbanned.
  • $ban (boolean, optional, default TRUE)
    If true, indicates this account is being banned (false means unbanned).

 

void mergeAccounts( \IPS\Member $member, \IPS\Member $member2 )

Called when two member accounts are merged.

  • $member (\IPS\Member, required)
    The first member account, and the one that is being retained. At point of calling, this object has the original member data.
  • $member2 (\IPS\Member, required)
    The second member account, and the one that will ultimately be deleted after the merge.

  Report Document


×
×
  • Create New...