A lot of things
- Added Database page. - Added Xenforo API compatibility - Added Hovercard - Added Notifications
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Auth\XenForoUser;
|
||||
use App\XenForoDataTypes\XenForoUserGroup;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class XenforoService {
|
||||
@@ -10,6 +12,45 @@ class XenforoService {
|
||||
private const int TTL_PERMISSIONS = 300;
|
||||
private const int TTL_ROUTES = 86400;
|
||||
|
||||
/**
|
||||
* Get specific XenForo user.
|
||||
*
|
||||
* @param int $xfUserId
|
||||
*
|
||||
* @return XenForoUser|null
|
||||
*/
|
||||
public function getXfUser( int $xfUserId ): ?XenForoUser {
|
||||
|
||||
$xfUser = \DB::connection('xenforo')
|
||||
->table('user')
|
||||
->where('user_id', $xfUserId)
|
||||
->first();
|
||||
|
||||
if(!$xfUser)
|
||||
return null;
|
||||
|
||||
return new XenForoUser($xfUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get specific XenForo user group.
|
||||
*
|
||||
* @param int $xfUserGroupId
|
||||
*
|
||||
* @return XenForoUserGroup|null
|
||||
*/
|
||||
public function getXfUserGroup( int $xfUserGroupId ): ?XenForoUserGroup {
|
||||
$xfUserGroup = \DB::connection('xenforo')
|
||||
->table('user_group')
|
||||
->where('user_group_id', $xfUserGroupId)
|
||||
->first();
|
||||
|
||||
if(!$xfUserGroup)
|
||||
return null;
|
||||
|
||||
return new XenForoUserGroup($xfUserGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get permissions for a specific user ID.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user