UserService
final class UserService
Provides functions for managing users.
Methods
Deletes user if not admin and unlinks profile images if $unlink is set to true.
Acts as safeguard to ensure incorrect user is not updated.
Uploads and sorts profile images.
Sends E-mail to user when account is deactivated as appropriate.
Sends E-mail to user when reset_password flag is set as appropriate.
Assist in toggling inactive field. Returns boolean value to determine if E-mail should be sent. To properly test if E-mail should be sent get value of $user->inactive before post.
Assist in toggling reset_password field.
Details
at line 29
static void
deleteIfAllowed(int $id, bool $unlink = false)
Deletes user if not admin and unlinks profile images if $unlink is set to true.
at line 46
static array
deleteProfileImage(Input $request)
Deletes profile image
at line 62
static void
ensureAuthenticatedUser(Users $user)
Acts as safeguard to ensure incorrect user is not updated.
at line 79
static void
handleProfileImages(Users $user, Uploads|null $uploads, string|null $sortedImages)
Uploads and sorts profile images.
at line 96
static void
sendWhenSetToInactive(Users $user, bool $shouldSendEmail = false)
Sends E-mail to user when account is deactivated as appropriate.
at line 111
static void
sendWhenSetToResetPW(Users $user, bool $shouldSendEmail = false)
Sends E-mail to user when reset_password flag is set as appropriate.
at line 129
static bool
toggleAccountStatus(Users $user, Input $request, int|null $currentInactive = null)
Assist in toggling inactive field. Returns boolean value to determine if E-mail should be sent. To properly test if E-mail should be sent get value of $user->inactive before post.
at line 144
static bool
toggleResetPassword(Users $user, Input $request, int|null $currentReset = null)
Assist in toggling reset_password field.
at line 156
static Users|bool
updatePassword(Users $user, Input $request)
Updates user's password