mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-08 09:26:42 +00:00
8e3f8de627
Closes #4500
24 lines
607 B
PHP
24 lines
607 B
PHP
<?php
|
|
|
|
namespace BookStack\Access;
|
|
|
|
use BookStack\Access\Notifications\UserInviteNotification;
|
|
use BookStack\Users\Models\User;
|
|
|
|
class UserInviteService extends UserTokenService
|
|
{
|
|
protected string $tokenTable = 'user_invites';
|
|
protected int $expiryTime = 336; // Two weeks
|
|
|
|
/**
|
|
* Send an invitation to a user to sign into BookStack
|
|
* Removes existing invitation tokens.
|
|
*/
|
|
public function sendInvitation(User $user)
|
|
{
|
|
$this->deleteByUser($user);
|
|
$token = $this->createTokenForUser($user);
|
|
$user->notify(new UserInviteNotification($token));
|
|
}
|
|
}
|