class UserModel (View source)

The user model.

Methods

changePassword(string $username, string $currentPassword, string $newPassword)

Change a user password

bool
resetPassword(string $username, string $newPassword1, string $newPassword2, Messenger $Messenger)

Handle password resetting.

bool
sendPasswordResetToken(User $User, Messenger $Messenger)

Send password reset token and store it in session.

bool
verifyPasswordResetToken(string $username, string $token)

Verify if the passed username/toke combination matches a token hash in the session data array.

Details

Response changePassword(string $username, string $currentPassword, string $newPassword)

Change a user password

Parameters

string $username
string $currentPassword
string $newPassword

Return Value

Response the response object

bool resetPassword(string $username, string $newPassword1, string $newPassword2, Messenger $Messenger)

Handle password resetting.

Parameters

string $username
string $newPassword1
string $newPassword2
Messenger $Messenger

Return Value

bool true on success

bool sendPasswordResetToken(User $User, Messenger $Messenger)

Send password reset token and store it in session.

Parameters

User $User
Messenger $Messenger

Return Value

bool true on success

bool verifyPasswordResetToken(string $username, string $token)

Verify if the passed username/toke combination matches a token hash in the session data array.

Parameters

string $username
string $token

Return Value

bool true if verified