diff --git a/app/Services/AccountSuspensionService.php b/app/Services/AccountSuspensionService.php index 6b8e66a..4a9236a 100755 --- a/app/Services/AccountSuspensionService.php +++ b/app/Services/AccountSuspensionService.php @@ -58,6 +58,16 @@ class AccountSuspensionService $user->bans->delete(); } + /** + * Checks whether a user is suspended + * + * @param User $user The user to check + * @return bool Whether the mentioned user is suspended + */ + public function isSuspended(User $user): bool { + return !is_null($user->bans); + } + @@ -101,19 +111,16 @@ class AccountSuspensionService return $user->save(); } - - /** - * Checks whether a user is suspended + * Checks whether an account is locked * * @param User $user The user to check - * @return bool Whether the mentioned user is suspended + * @return bool Whether the mentioned account is locked */ - public function isSuspended(User $user): bool { - return !is_null($user->bans); + public function isLocked(User $user): bool { + return $user->administratively_locked == 1; } - /** * Retrieves the reason for the user's suspension. * @@ -131,33 +138,6 @@ class AccountSuspensionService return null; } - /** - * Checks whether an account is locked - * - * @param User $user The user to check - * @return bool Whether the mentioned account is locked - */ - public function isLocked(User $user): bool { - return $user->administratively_locked == 1; - } - - /** - * Takes a suspension directly and makes it permanent. - * - * @param Ban $ban The suspension to make permanent - */ - public function makePermanent(Ban $ban): void { - - Log::alert('A suspension has just been made permanent.', [ - 'target_email' => $ban->user->email - ]); - - $ban->bannedUntil = null; - $ban->isPermanent = true; - - $ban->save(); - - } /** * Purges old, expired suspensions from the database