mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-13 05:53:55 +08:00
23 lines
586 B
PHP
23 lines
586 B
PHP
|
<?php namespace BookStack\Auth\Access;
|
||
|
|
||
|
use BookStack\Auth\User;
|
||
|
use BookStack\Notifications\UserInvite;
|
||
|
|
||
|
class UserInviteService extends UserTokenService
|
||
|
{
|
||
|
protected $tokenTable = 'user_invites';
|
||
|
protected $expiryTime = 336; // Two weeks
|
||
|
|
||
|
/**
|
||
|
* Send an invitation to a user to sign into BookStack
|
||
|
* Removes existing invitation tokens.
|
||
|
* @param User $user
|
||
|
*/
|
||
|
public function sendInvitation(User $user)
|
||
|
{
|
||
|
$this->deleteByUser($user);
|
||
|
$token = $this->createTokenForUser($user);
|
||
|
$user->notify(new UserInvite($token));
|
||
|
}
|
||
|
}
|